红茶维基
mengwiki
https://meng.miraheze.org/wiki/Main_Page
MediaWiki 1.39.4
first-letter
媒体文件
特殊
讨论
用户
用户讨论
红茶维基
红茶维基讨论
文件
文件讨论
MediaWiki
MediaWiki讨论
模板
模板讨论
帮助
帮助讨论
分类
分类讨论
表单
表单讨论
Campaign
Campaign talk
User blog
User blog talk
模块
模块讨论
话题
MediaWiki:Privacypage
8
503
1665
2022-05-27T11:28:18Z
Pio
2
Created blank page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
MediaWiki:Disclaimerpage
8
504
1666
2022-05-27T11:28:36Z
Pio
2
Created blank page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
分类:模板
14
505
1667
2022-05-27T11:29:23Z
Pio
2
Created blank page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
1668
1667
2022-05-27T11:30:52Z
Pio
2
创建空白页面
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:糖浆立绘.png
6
511
1674
2022-05-27T11:37:45Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
MediaWiki:Disclaimers
8
513
1676
2022-05-27T11:38:40Z
Pio
2
创建空白页面
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
MediaWiki:Mainpage
8
515
1678
2022-05-27T11:40:43Z
Pio
2
创建页面,内容为“Main_Page”
wikitext
text/x-wiki
Main_Page
8f9e9b397d590520d0938b3a063c1c0b58ba8445
模板
0
516
1679
2022-05-27T18:41:30Z
Pio
2
重定向页面至[[分类:模板]]
wikitext
text/x-wiki
#REDIRECT [[分类:模板]]
8f98eb721b2473c51bc6ffd6b73a5fd7590c49a1
文件:Wiki.png
6
518
1681
2022-06-06T11:32:45Z
Pio
2
已保护“[[文件:Wiki.png]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
== 摘要 ==
wiki icon
97dbfc3375b6cccb0a99182bb40e8afc36a9760f
文件:Sakura.png
6
510
1673
2022-06-06T11:33:14Z
Pio
2
已保护“[[文件:Sakura.png]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
模板:Flow提及
10
2
1683
2022-06-07T04:45:56Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
@[[用户:{{{1|Example}}}|{{{2|{{{1|Example}}}}}}]]
1c966dbfb5339d5fd60705b35e01ab94439587e1
2
2023-02-26T03:31:14Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
@[[用户:{{{1|Example}}}|{{{2|{{{1|Example}}}}}}]]
1c966dbfb5339d5fd60705b35e01ab94439587e1
模板:LQT移动了帖子存档,并转换成Flow
10
3
1684
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
这个由{{{author}}}发表的帖子已于{{{date}}}移动。您可以在[[{{{title}}}]]找到。
41a65e8d35f89b0dead36156cafb79721217999b
模板:LQT页面已转换为Flow
10
4
1685
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
既往的页面历史已于{{#time: Y-m-d|{{{date}}}}}基于备份目的存档在<span class='flow-link-to-archive'>[[{{{archive}}}]]</span>。
61646601788182dcaa29e3aca4bf0bac24581e1d
模板:已转换的LQT页面的存档
10
5
1686
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
此页面是已存档的LiquidThreads页面。<strong>请不要编辑此页面内容</strong>。请直接在[[{{{from}}}|当前讨论页]]发表额外评论。
b628192ae9c1e59e13388afd0e1ada1ce53707c9
模板:LQT帖子被一名已屏蔽的用户导入
10
6
1687
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
此修订是从一位被屏蔽的用户的LiquidThreads导入的,现已重新分配至当前用户。
30d8054223edd9669bd8378efda962c1210326a3
模板:LQT帖子已连带不同签名的用户导入
10
7
1688
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
<em>此帖子曾由[[User:{{{authorUser}}}|{{{authorUser}}}]]发布,但被表示为[[User:{{{signatureUser}}}|{{{signatureUser}}}]]。</em>
2520a353784310f236d24ad0af1b6d75d9704c8c
模板:从wikitext讨论页转换为Flow
10
8
1689
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
既往讨论已于{{#time: Y-m-d|{{{date}}}}}存档在<span class='flow-link-to-archive'>[[{{{archive}}}]]</span>。
64d86eda57c570406568dbdc891ee20fe62036c1
模板:来自已转换的wikitext讨论页的存档
10
9
1690
2022-06-07T04:45:57Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
此页面是存档页面。<strong>请不要编辑此页面内容</strong>。请直接在[[{{{from|{{TALKSPACE}}:{{BASEPAGENAME}}}}}|当前讨论页]]发表额外评论。
4361343f9c6451978ee270a83828fa766742e801
话题:Wwzf24m621q017ra
2600
520
1691
2022-06-07T05:23:52Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"wwzf24m621q017ra"}
0413d9f0fe5b5403be4eab04b1049e6b756e392f
文件:三人行-陈亦凯-老师-俞迦勒.jpg
6
522
1693
2022-06-07T07:28:08Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:看板娘DOUBLE.jpg
6
523
1694
2022-06-09T14:11:32Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:鵺立绘.png
6
524
1695
2022-06-09T14:23:31Z
Pio
2
②号看板娘
wikitext
text/x-wiki
== 摘要 ==
②号看板娘
2171e4270c55c0d8fdc892d3cb62bf493e360d09
话题:Wxq1lt11o9i6qzra
2600
529
1700
2022-06-19T04:15:54Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"wxq1lt11o9i6qzra"}
4f54391b8187f2a52e04a4e6046ec6ce8dece8f6
陈嘉凝
0
530
1701
2022-07-11T06:09:40Z
Pio
2
Loli移动页面[[陈嘉凝]]至[[小火龙]]:Privacy protect
wikitext
text/x-wiki
#重定向 [[小火龙]]
6d384a8acf6cbf1a1844eef3e1e14bbb27052550
Cry
0
532
1703
2022-07-11T06:11:32Z
Pio
2
Loli移动页面[[Cry]]至[[肉圆]]:正式网名(迫真
wikitext
text/x-wiki
#重定向 [[肉圆]]
fe0c264911dab23eed8d96d8a8c50f293bf3bb58
陈若远
0
531
1702
2022-07-11T06:11:54Z
Pio
2
已将重定向目标从[[Cry]]更改为[[肉圆]]
wikitext
text/x-wiki
#重定向 [[肉圆]]
fe0c264911dab23eed8d96d8a8c50f293bf3bb58
文件:小火龙on公众号.jpg
6
512
1675
2022-07-11T06:21:54Z
Pio
2
Loli移动页面[[文件:陈嘉凝on公众号.jpg]]至[[文件:小火龙on公众号.jpg]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:陈嘉凝on公众号.jpg
6
533
1704
2022-07-11T06:21:54Z
Pio
2
Loli移动页面[[文件:陈嘉凝on公众号.jpg]]至[[文件:小火龙on公众号.jpg]]
wikitext
text/x-wiki
#重定向 [[文件:小火龙on公众号.jpg]]
b43a94a989e36cb18218d96192bb8092c1e69760
分类:老师
14
534
1705
2022-07-11T08:02:54Z
Pio
2
创建空白页面
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:V2-fd4b485006b55bfd45c13f4348e1e1ee.png
6
535
1706
2022-07-23T03:25:11Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:C61FBDFD-40FF-4C9E-B453-6F80E5C1F79C.jpeg
6
536
1707
2022-08-17T15:37:05Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:3677(20220819-172038).jpg
6
538
1709
2022-08-19T09:32:24Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:3678(20220819-172055).jpg
6
539
1710
2022-08-19T09:33:08Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:3679(20220819-172109).jpg
6
540
1711
2022-08-19T09:34:06Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
220813Feminism
0
541
1712
2022-08-19T12:21:42Z
Pio
2
重定向页面至[[220813总群关于女权争议]]
wikitext
text/x-wiki
#REDIRECT [[220813总群关于女权争议]]
33ac6ed4f5d7fb0b397d7b35fc77832d0a7dd7bc
MediaWiki:Titleblacklist
8
517
1680
2022-10-29T13:00:02Z
Pio
2
清空全部内容
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
用户:Shiroto-ruya
2
544
1715
2023-02-11T17:52:03Z
d3hcn>Shiroto-ruya
0
/* 简介 */
wikitext
text/x-wiki
== 你也可以叫咱:白音露娅 ==
算是活跃编辑者,毕竟没几个人编辑
肉圆的……朋友……算了他不配。
拿这个wiki来练手写代码,可能之后能用上这样的技术吧
== 简介 ==
同人作家,似乎在开自创(毕竟肉圆会把他的活丢给我)
是某小火龙深恶痛绝的男性向作品制造人,不过咱也不是不会写女性向作品啦……
实话说现在真的还会有这种东西的区分吗?这让LGBT群体情何以堪?为什么某些人不替她们打拳?
有一个妹妹,因为某些特殊原因咱的所有账号都是与她共用的,所以如果某天看到不像咱说话语气的发言也请不要惊慌哦
目前活跃于:
{|
|bilibili
|-
|Lofter
|-
|Twitter
|-
|Pixiv
|}
可以来这里找咱玩哦~
对了对了,咱的创作偏好是百合/纯爱,如果某天发现咱发布了过于黑暗的内容……说明那是咱妹妹发的
以上~
6dcf8cbf42b839b1492a6399b00d2119bf348d33
话题:Xclsedhuq5pib5ae
2600
546
1717
2023-02-14T16:17:26Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"xclsedhuq5pib5ae"}
c4e7e7a4e8a030d900d4691735dd2102620ea782
话题:Xctqc0kz2z81os5i
2600
547
1718
2023-02-18T05:51:47Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"xctqc0kz2z81os5i"}
4966c31eda585f54135156a68bc2645d2096f48d
220813总群关于女权争议
0
537
1708
2023-02-18T07:18:45Z
Pio
2
将主观内容移出references
wikitext
text/x-wiki
== 简介 ==
[[文件:C61FBDFD-40FF-4C9E-B453-6F80E5C1F79C.jpeg|替代=肉圆转发到截图|缩略图|肉圆转发到截图]]
是由右边微博在新总群引发的一系列争议。
== 经过 ==
2022年8月12日,[[肉圆]]在总群内转发一微博<ref>截图来自蓝鸟用户对微博截图</ref>,并附文“这一拳,贯穿星河”。群内一22级陈某吐槽了发博者的奇妙逻辑后,表示并未看出哪里在打拳,说那男的不是妈宝男,并反复强调要远离妈宝男。
转博<ref>这里转博指转发微博截图的人</ref>的[[肉圆]]出场。陈某不解[[肉圆]]为什么认为这个发博<ref>这里发博指转发官方微博那个人</ref>这是一个女权,[[肉圆]]表示是经验{{黑幕|微博、女权、贴标签、人身攻击、普通女生,这里面有一个词与其他词不搭调,请找出来}}。
陈某质问其只是光看这一句话就得出的结论。<del>此时[[时守宫Elona]]也表达了一些观点,但由于他似乎有点没搞清楚状况就不提了。</del>[[肉圆]]:我就转发个乐子也能吵。陈某:你转这个就莫名奇妙。[[肉圆]]:那我能转什么。
这时,陈某突兀扯到了本次聊天最为{{黑幕|典}}迷惑言论之一:{{引用|祝你们下辈子当个女的试试}}
[[用户:Loli]]上线后,嘲讽了陈某无非是在当'''理中客''',[[肉圆]]也对自己转博的缘由做出了解释,只是为了给大家看乐子。
[[小火龙]]开始发言,列举一系列事例,论证了当代社会性别矛盾相对严重。随后她指责某些人假装看不见性别矛盾。{{黑幕|笔者这里大胆猜想她是在指责说看不出来发博者是女权的陈某?}}{{引用|有时候不就事论事是耍流氓。但有时候就事论事也可能是耍流氓。没有一个事件是孤立的。所有表相符号底下都要深层因果|[[小火龙]]}}
但全场就事论事的<del>除了认真讨论女权问题的</del>只有那位质疑''你判断她是女权难道就是凭这一句话''的陈某了。
陈某继而认为,部分极端女权是在受生活创伤下产生{{黑幕|不说大多数极端女权到底是不是“受生活创伤”。受到生活创伤,想到的却是攻击男性而不是伤害自己的人、反抗那些人,''真没啥可怜的''}}。
[[小火龙]]又说毕竟我群向来嘲极端女权者多,极端男权者少。[[用户:Loli]]表明只是因为极端女权声量远大于极端男权。[[小火龙]]反驳:但是极端男权实践者多。
编者实在好奇极端男权实践者如何'''多''',便稍微查询了一下。只就大陆发生受到人权侵害事件而言,女性是受害者的事件{{黑幕|而且作案者也不全是极端男权}}在所有事件中占比<big>'''高达21%-35%'''</big><ref>数据来源 联合国毒品和犯罪问题办公室,http://www.unodc.org/documents/gsh/data/GSH2013_Sex_data.xlsx https://cnlgbtdata.com/files/uploads/2020/01/%E4%B8%AD%E5%9B%BD%E7%A4%BE%E4%BC%9A%E4%B8%AD%E7%9A%84%E5%A5%B3%E4%BA%BA%E5%92%8C%E7%94%B7%E4%BA%BA2019CN-final.pdf</ref>
== 后续 ==
[[肉圆]]编写的机器人[[糖浆(bot)]]实现了发男性向色图(性暗示,非R18)功能。在社团群内被群友<del>调戏</del>实验后,被[[小火龙]]制止,并表示这是二钱红茶社团官方群,要发自己建男性向小群发。
此事尽管与主条目无关联,但随后[[小火龙]]发表的动态提及此事,故编写在本条目中。
<gallery mode="nolines" caption="动态">
3677(20220819-172038).jpg|1
3678(20220819-172055).jpg|2
3679(20220819-172109).jpg|3
</gallery>
== 参见 ==
<references />
[[分类:性别矛盾]]
[[分类:女权]]
37a12064210957cb3f16fcb3464226fda800d127
杰茜·伊芙莉娅
0
543
1714
2023-02-18T17:49:21Z
Pio
2
建议使用空行来换行而并非br标签
wikitext
text/x-wiki
== 基本信息 ==
{|class="wikitable",style="text:200%"
|姓名:杰茜·伊芙莉娅
|-
|性别:女
|-
|种族:人类/哈比
|-
|年龄:???
|-
|发色:(人类)灰发 / (哈比)黑发高马尾
|-
|瞳色:(人类)绿瞳 / (哈比)蓝瞳
|-
|身高:165
|-
|体重:你在问什么?
|-
|三围:平的,好了吧,这下你满意了吧?
|}
== 简介 ==
因为某些不知名原因而两位灵魂共用一具躯体的少女,经过了长时间的磨合已经完全成为同一个人了
(不过拜之所赐可以切换两种不同的外表形态就是了)
似乎有着某些悲惨的过去,所以她乐于救人于危难之中
(顺带一提,她似乎有着“奴隶商人杀手”这样的外号)
对于侦探事务所有着狂热的爱好,曾经在自己一时兴起的状况下建立了某服务范围现在已经遍及全位面的事务所
并且自己还在暗中当着这一组织背后的大BOSS
她自己本身也可谓是传奇调查员,在「钳」的因果崩坏后奔赴各地处理了无数的事端
现在也在以调查员的身份活跃着,但因为她早已赚得盆满钵满,大部分时候还是待在车站边的家中养老
== 个人情况 ==
由于是共用一具身体,两人的体态都差不多,而且都是完全没有料的身体呢~
不过两种形态还是有些许的不同的~
人类形态时运动能力相对较差,但是思维会更加的活跃,总体的性格偏向细心与耐心
这时她总是懒得整理自己的头发,于是大多数时间都是梳一个简单的刘海,只有在重要的时候才会改变自己的发型
哈比形态时的运动能力大约强了一倍且身后会长出一对黑色的翅膀,可以提供短时间的飞行<del>长按空格键可以缓降</del>,但是美中不足的是在这种情况下她会变成马大哈,相当的粗心大意,总体的性格偏向大胆与外向<br>
这时为了方便运动,她会在头顶上把头发扎成一个马尾,这样就不会干扰视线了<br>
另外,不论在任何情况下,她的头发都只到肩膀
穿衣相当的随便,一般都是辣妹模样的套一件T恤外加短裤了事,白衬衫与格子服也在她的考虑范围之中
讨厌套头衫与运动服外套,但好像很喜欢那种全是口袋的风衣?
因为穿衣问题经常被洛基教训
在重要场合会像玩偶一样被她套上正装
除此以外,人类形态偏爱贝雷帽;哈比形态偏爱鸭舌帽,头发可以从后面的孔里穿过
== 一些不太重要的情报 ==
1.家的位置在与红茶馆隔半个湖相望的湖边,与守崖人的家在湖的对象两岸
是一个喜欢大房子的人,家中各种设施一应俱全
(有传闻称她的房子与红茶馆有密道相连)
2.与守崖人的关系似乎不太一般,感觉……好像……就像……母女一样?
对此糖浆和鵺似乎知道些什么,然而并不公开有关于此的情报
3.养了一只[[洛基·伊芙莉娅|蓝毛兔耳娘]]做女儿,但是这位女儿似乎不单纯的把自己的妈当妈(?)
4.热爱音游,曾斥巨资在红茶馆底层建了一个音游窝,里面配备了包括但不限于SBGA御三家、山东卫星、3DX、吴丽芳、大鼓达入的机框
平时也随身携带着下载了各大移动端音游的iQad
虽然如此但是技术超级拉胯。比如作为一个练习时长两年半的《源神》玩家,PPT却只是在11.45徘徊;《maomao地插》的底分只有6000
但是还是非常喜欢越级,因此如果下次在哪个机厅看到她在越级,可以上去疯狂的骑脸嘲讽,请务必嘲讽到她哭出来为止
c3c6cadf96749d33a9a23af0bc1dd0b5bc8abde1
洛基·伊芙莉娅
0
545
1716
2023-02-18T17:52:47Z
Pio
2
修正格式错误
wikitext
text/x-wiki
{|class="wikitable"
|姓名:洛基·伊芙莉娅
|-
|性别:女
|-
|种族:半兽人(兔人族)
|-
|年龄:40岁(心理:20岁)
|-
|发型:蓝色双马尾
|-
|瞳色:金瞳
|-
|身高:155
|-
|体重:46kg
|-
|三围:比一般人的数值小许多
|}
== 简介 ==
杰茜的现任女仆,但是是自愿的,实际上杰茜是想把她当成女儿来养的
出现这样结果的契机是在她8岁的时候被奴隶商人抓走,结果被杰茜救下,于是从此一直跟随着杰茜,但是她要成为女仆的原因似乎有点不太正常
作为女仆可谓是完美无瑕,只不过有时候会对杰茜做出一些莫名其妙的迫害行为,比如往牛奶里加电脑配件什么的
由此可见,她对杰茜的感情究竟是尊敬还是忠诚还是爱慕仍是个不定论(雾)
毫不意外的是一位战斗女仆,战斗时总是位于队伍的后端使用热武器进行狙击或是大规模杀伤
但近战的水平略有些蹩脚
== 个人情况 ==
是一只蓝毛的兔耳娘,及腰的长发在脑后跟被扎成了两个马尾
身体发育可谓是不良,大约是年少时受到的残忍对待造成的影响,虽然现在的年纪在她的族群已经可以被算作青年了但仍然只有初中生的体型
最常用的衣服是女仆装,平时便一直穿在身上,据其声称是为了“更好的实现对小姐(杰茜)的服务”,不过很大一部分原因大概还是她自己喜欢吧
性格比较内向,在不熟的人面前不会轻易搭话甚至露出笑容,但是对待杰茜则完全就是另一副德性了
除此以外还十分的固执,平时相当严格地要求并对待自己,在与他人起争执的时候也毫不让步,甚至对杰茜也是这样的
体内的以太含量极小,只能使用最基础的魔术
一年有几天的“生理期”,一般由杰茜的魔术帮忙解决,但是似乎有几次出现了麻烦
== <del>一句话说不完的</del>情报==
1.据可靠信息来源(糖浆):洛基会迷上女仆这一职业似乎是因为杰茜在救下她时穿着女仆装,但是当时究竟发生了什么我们无从得知
2.她的女仆装似乎由糖浆侧供货,而令她立即决定下单的原因相传是这段话:
{{引用|什么?这可不是女仆装,这是女仆战斗服!别看它现在这样紧绷绷的,遇到战斗的时候就迅速变大变松,用来运动与防弹都很方便!|糖浆.奸商ver}}
一件就耗掉了她从杰茜那里一个月拿到的工资(零花钱),虽然达成了目的但是闷闷不乐了几天(毕竟妈妈给的零花钱就这么没了),不过后来杰茜笑着报销了并且如此劝说(威胁)糖浆之后免费供应服装:
{{引用|什么?这不是抢劫~这是济贫!我寻思着你馆也不缺每个月一件衣服的钱对吧?糖浆?|杰茜(已黑化)}}
3.给杰茜下过好几次电脑配件,其中曾有一次成功过但由于杰茜前晚熬夜因此才刚在床上把对面拉链拉开就睡过去了
据推测药物的提供者大概率是为了报复的糖浆
(洛基:合着我还成最终赢家了?)
4.喜欢使用步枪、冲锋枪与狙击枪,讨厌使用霰弹枪(因为实战时容易误伤),不过好像很喜欢手持AA12时那种成为上帝的感觉
4308cf67b28f7eabd6241672abf375bedcebe9f1
文件:8350C84E-FD64-4C66-8417-CD14A63E0136.jpeg
6
548
1719
2023-02-18T18:15:26Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
MediaWiki:Copyright
8
549
1720
2023-02-19T03:46:10Z
Pio
2
wikitext
text/x-wiki
本网站内容采用$1授权。
d5f9df245f3b4697e65938c964335b8221db5f1b
「半自动化·糖浆」
0
542
1713
2023-02-23T09:02:39Z
Pio
2
Loli移动页面[[糖浆(bot)]]至[[「半自动化·糖浆」]]:修正为官方名称
wikitext
text/x-wiki
由[[肉圆]]维护,基于Nonebot on go-cqhttp的新一代机器人。
== 功能 ==
=== 签到 ===
发送带“运势”的字符串即可查看。
=== 运势 ===
<del>疑似</del>使用random
=== setu ===
{{黑幕|惨遭到[[小火龙]]制裁}}
a9b93e1f8dc0069d3253d79fa7e87e9e21c91cb7
糖浆(bot)
0
551
1722
2023-02-23T09:02:39Z
Pio
2
Loli移动页面[[糖浆(bot)]]至[[「半自动化·糖浆」]]:修正为官方名称
wikitext
text/x-wiki
#重定向 [[「半自动化·糖浆」]]
2a381d26d617968794b2540a3e22ad18b7f5e71f
话题:Xda2vipmqgb48ghy
2600
552
1723
2023-02-25T13:59:27Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"xda2vipmqgb48ghy"}
5ac13d2af261d3f3d5072f64a58d510eb3a75a93
文件:4PJ366NX42SIU1N6H6.png
6
553
1724
2023-02-25T14:34:47Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
首页
0
1
1
2023-02-25T16:46:09Z
MediaWiki default
1
创建首页
wikitext
text/x-wiki
__NOTOC__
== 欢迎来到 {{SITENAME}}! ==
此首页被自动创建并且似乎尚未替换。
=== 致此wiki的行政员 ===
您好,欢迎来到您的新wiki!感谢您选择Miraheze托管您的wiki,我们希望您享受我们的托管服务。
您可以立刻或者随时在您的wiki上开始工作。
需要帮助?没问题!我们在需要时会帮助您管理您的wiki。要开始入门,请查看这些有用的链接:
* <span class="plainlinks">[[mw:Special:MyLanguage/Help:Contents|MediaWiki手册]](例如导航、编辑、删除页面、封禁用户等)
* [[meta:Special:MyLanguage/FAQ|Miraheze常见问题]]
* [[meta:Special:MyLanguage/Request features|请求在您的wiki上进行设置更改]]。(扩展及标志/Favicon更改应通过您的wiki上的[[Special:ManageWiki]]完成,详见[[meta:Special:MyLanguage/ManageWiki|ManageWiki]]。)</span>
==== 有些地方我仍然不懂! ====
这不是问题。如果有什么在文档/常见问题上没解释的东西,我们高兴帮助您。您可以在此找到我们:
* [[meta:Special:MyLanguage/Help center|在我们自己的Miraheze wiki]]</span>
* [[phab:|Phabricator]]
* [https://miraheze.org/discord Discord]
* 在irc.libera.chat上的IRC频道#miraheze([irc://irc.libera.chat/%23miraheze 直接连接];[https://web.libera.chat/?channel=#miraheze 网络聊天])
=== 对于此wiki的访问者 ===
您好,此wiki的默认首页(本页)尚未被此wiki的行政员替换为自己的内容。行政员可能正在编写首页的内容,所以请稍后检查此页面!
62a0224da3b49ec95f81f8f1c605577862deca78
模板:LQT移动了帖子存档,并转换成Flow
10
3
3
2023-02-26T03:31:22Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
这个由{{{author}}}发表的帖子已于{{{date}}}移动。您可以在[[{{{title}}}]]找到。
41a65e8d35f89b0dead36156cafb79721217999b
模板:LQT页面已转换为Flow
10
4
4
2023-02-26T03:31:25Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
既往的页面历史已于{{#time: Y-m-d|{{{date}}}}}基于备份目的存档在<span class='flow-link-to-archive'>[[{{{archive}}}]]</span>。
61646601788182dcaa29e3aca4bf0bac24581e1d
模板:已转换的LQT页面的存档
10
5
5
2023-02-26T03:31:27Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
此页面是已存档的LiquidThreads页面。<strong>请不要编辑此页面内容</strong>。请直接在[[{{{from}}}|当前讨论页]]发表额外评论。
b628192ae9c1e59e13388afd0e1ada1ce53707c9
模板:LQT帖子被一名已屏蔽的用户导入
10
6
6
2023-02-26T03:31:29Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
此修订是从一位被屏蔽的用户的LiquidThreads导入的,现已重新分配至当前用户。
30d8054223edd9669bd8378efda962c1210326a3
模板:LQT帖子已连带不同签名的用户导入
10
7
7
2023-02-26T03:31:33Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
<em>此帖子曾由[[User:{{{authorUser}}}|{{{authorUser}}}]]发布,但被表示为[[User:{{{signatureUser}}}|{{{signatureUser}}}]]。</em>
2520a353784310f236d24ad0af1b6d75d9704c8c
模板:从wikitext讨论页转换为Flow
10
8
8
2023-02-26T03:31:36Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
既往讨论已于{{#time: Y-m-d|{{{date}}}}}存档在<span class='flow-link-to-archive'>[[{{{archive}}}]]</span>。
64d86eda57c570406568dbdc891ee20fe62036c1
模板:来自已转换的wikitext讨论页的存档
10
9
9
2023-02-26T03:31:39Z
Flow talk page manager
4
/* Automatically created by Flow */
wikitext
text/x-wiki
此页面是存档页面。<strong>请不要编辑此页面内容</strong>。请直接在[[{{{from|{{TALKSPACE}}:{{BASEPAGENAME}}}}}|当前讨论页]]发表额外评论。
4361343f9c6451978ee270a83828fa766742e801
User blog:Loli/Hello World!
502
554
1725
2023-02-26T03:54:59Z
Pio
2
已创建新的博客帖子。
wikitext
text/x-wiki
<!--start text-->
Hello World!
[[分类:用户Loli的文章]]
[[分类:2023年2月26日 (星期日)]]
__NOEDITSECTION__
82c29b6d62d18add7b4f2c8c11d56358dedb7031
分类:用户Loli的文章
14
555
1726
2023-02-26T03:56:01Z
Pio
2
wikitext
text/x-wiki
[[文件:8350C84E-FD64-4C66-8417-CD14A63E0136.jpeg|缩略图]]网管,是萝莉控。
網站管理員,是蘿莉控。
Webmaster, also a lolicon.
Webサイト管理者、ロリコン。
cb643c1d8968eae28071b7c46b9c3964704695a3
MediaWiki:Portal-url
8
556
1727
2023-02-26T05:09:43Z
Pio
2
创建页面,内容为“Main_Page”
wikitext
text/x-wiki
Main_Page
8f9e9b397d590520d0938b3a063c1c0b58ba8445
MediaWiki:Citizen-footer-desc
8
558
1729
2023-02-26T06:49:17Z
Pio
2
创建页面,内容为“红茶社百科全书!”
wikitext
text/x-wiki
红茶社百科全书!
358ce5df3814bd950beaf26f3ac87439ffb9a651
文件:Favicon.ico
6
560
1731
2023-02-26T07:14:16Z
Pio
2
使用UploadWizard上传自己的作品
wikitext
text/x-wiki
=={{int:filedesc}}==
{{Information
|description={{zh-cn|1=site icon}}
|date=2023-02-26
|source={{own}}
|author=[[User:Loli|Loli]]
|permission=
|other versions=
}}
=={{int:license-header}}==
{{licensing|generic}}
600f31753c46aa94bb274e7bbffc300c82e9dec0
MediaWiki:Citizen-page-info-0
8
561
1732
2023-02-26T07:21:49Z
Pio
2
创建页面,内容为“访问次数”
wikitext
text/x-wiki
访问次数
5a7c4ad0465eace78ba149a48b04ccf2902b543f
文件:糖浆设定参照2.2.jpg
6
562
1733
2023-03-04T07:05:04Z
Pio
2
使用UploadWizard上传自己的作品
wikitext
text/x-wiki
=={{int:filedesc}}==
{{Information
|description={{zh-cn|1=糖浆设定参照2.2}}
|date=2021-01-23
|source={{own}}
|author=[[User:Loli|Loli]]
|permission=
|other versions=
}}
=={{int:license-header}}==
{{licensing|generic}}
b74e1d0b2960a381fdab5e74ce119ce3cca97801
文件:糖浆设定参照2.1.jpg
6
563
1734
2023-03-04T07:05:04Z
Pio
2
使用UploadWizard上传自己的作品
wikitext
text/x-wiki
=={{int:filedesc}}==
{{Information
|description={{zh-cn|1=糖浆设定参照2.1}}
|date=2021-01-23
|source={{own}}
|author=[[User:Loli|Loli]]
|permission=
|other versions=
}}
=={{int:license-header}}==
{{licensing|generic}}
4ec00daed111270d3bbe770ec84b699e81715aa5
模板:Hide
10
564
1735
2023-03-04T07:07:40Z
Pio
2
创建页面,内容为“<includeonly><table class="mw-collapsible {{#ifeq:{{#switch:show|{{{show|}}}|{{{1|}}}=true|#default=false}}|true||mw-collapsed}} wikitable" {{#if:{{{width|}}}|style="width: {{{width}}}"}} {{#if:{{{expandtext|}}}|data-expandtext="{{{expandtext}}}"|}} {{#if:{{{collapsetext|}}}|data-collapsetext="{{{collapsetext}}}"|}}> <tr> <th>{{{标题|{{{標題|{{#ifeq:{{{1}}}|show|{{{2|}}}|{{{1|}}}}}}}}}}}</th> </tr> <tr> <td> {{{内容|{{{內容|{{#ifeq:{{{1}}}|show|{{{3|}}}…”
wikitext
text/x-wiki
<includeonly><table class="mw-collapsible {{#ifeq:{{#switch:show|{{{show|}}}|{{{1|}}}=true|#default=false}}|true||mw-collapsed}} wikitable" {{#if:{{{width|}}}|style="width: {{{width}}}"}} {{#if:{{{expandtext|}}}|data-expandtext="{{{expandtext}}}"|}} {{#if:{{{collapsetext|}}}|data-collapsetext="{{{collapsetext}}}"|}}>
<tr>
<th>{{{标题|{{{標題|{{#ifeq:{{{1}}}|show|{{{2|}}}|{{{1|}}}}}}}}}}}</th>
</tr>
<tr>
<td>
{{{内容|{{{內容|{{#ifeq:{{{1}}}|show|{{{3|}}}|{{{2|}}}}}}}}}}}
</td>
</tr>
</table></includeonly><noinclude>[[分类:功能模板]]</noinclude>
4957743c81d0169c095405e645584ec8df3fc72e
话题:Xdp2gmb7ixaref6v
2600
565
1736
2023-03-04T07:28:28Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"xdp2gmb7ixaref6v"}
30d63961951df7ff692e4435f9361691d126bfab
文件:T2slz2k5.png
6
566
1737
2023-03-04T13:37:15Z
Pio
2
使用UploadWizard上传自己的作品
wikitext
text/x-wiki
=={{int:filedesc}}==
{{Information
|description={{zh-cn|1=嘉然可爱捏}}
|date=2020-01-01
|source={{own}}
|author=[[User:Loli|Loli]]
|permission=
|other versions=
}}
=={{int:license-header}}==
{{licensing|generic}}
42800e6754dce5976bef905b5ce1bc3475685801
话题:Xdpn0dmzkq9he8h3
2600
567
1738
2023-03-04T13:37:27Z
Flow talk page manager
4
/* 已将此页面转换为结构式讨论板块 */
flow-board
application/json
{"flow-workflow":"xdpn0dmzkq9he8h3"}
e46b220f4aed748deab00771626752b916a3d8ef
文件:糖浆立绘2.0.jpg
6
568
1739
2023-03-04T16:22:38Z
d3hcn>Shiroto-ruya
0
Shiroto-ruya上传[[文件:糖浆立绘2.0.jpg]]的新版本
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
用户:Shiroto-ruya/old index
2
569
1740
2023-03-04T16:37:16Z
d3hcn>Shiroto-ruya
0
创建页面,内容为“== 因为更新以及各种原因,老的主要以及不适用了(悲) == == 这里是红茶馆 == <div class="nomobile"> <div style="border:1px solid black;border-radius:3px;"> {| class="wikitable" style="width:100%;position:relative;top:-14px;" |+ style="background-color:aqua;font-size:larger;" |⭐欢迎来到红茶维基⭐ | colspan="3" |<center></center> |- |<center>作品相关</center>||<center>新闻公告</center> |- | <div style="float:left;paddi…”
wikitext
text/x-wiki
== 因为更新以及各种原因,老的主要以及不适用了(悲) ==
== 这里是红茶馆 ==
<div class="nomobile">
<div style="border:1px solid black;border-radius:3px;">
{| class="wikitable" style="width:100%;position:relative;top:-14px;"
|+ style="background-color:aqua;font-size:larger;" |⭐欢迎来到红茶维基⭐
| colspan="3" |<center></center>
|-
|<center>作品相关</center>||<center>新闻公告</center>
|-
|
<div style="float:left;padding-right:5px;">
<span style="display:block;text-align:center;font-size:larger;background-color:#609ed7;">人物</span><br>
<span style="font-size:smaller;position:relative;top:-10px;">「钳」位面中究竟出场了多少人物? </span>
<hr>
{| class="wikitable mw-collapsible" style="width:100%;"
|+红茶馆
|-
|<center>[[糖浆]]</center>||<center>[[鵺]]</center>
|-
|}
<hr>
{| class="wikitable mw-collapsible" style="width:100%;"
|+璃斗·丝洛芙尔事务所
|-
|<center>[[杰茜·伊芙莉娅|杰茜]]</center>||<center>[[洛基·伊芙莉娅|洛基]]</center>
|-
|}
</div>
<div style="float:left;padding-left:5px;padding-right:5px;border-left:1px solid gray;border-right:1px solid gray;">
<span style="display:block;text-align:center;font-size:larger;background-color:#309e47;">常客</span><br>
<span style="font-size:smaller;position:relative;top:-10px;">红茶馆的长期支持者~在此感谢~</span>
<hr>
{| class="wikitable mw-collapsible" style="width:100%;"
|+主
|-
|<center>[[小火龙]]</center>
|-
|}
<hr>
{| class="wikitable mw-collapsible" style="width:100%;"
|+19部分
|-
| <center>[[酸柠萌]]</center>||<center>[[火华子]]</center>
|-
|}
<hr>
{| class="wikitable mw-collapsible" style="width:100%;"
|+20部分
|-
|<center>[[肉圆]]</center>
|-
|}
<hr>
||
|}
</div>
</div>
</div>
736544f2a0f000f2af90af48d8bf5e0c6aa7bc2c
杰茜
0
570
1741
2023-03-11T12:00:01Z
Pio
2
重定向页面至[[杰茜·伊芙莉娅]]
wikitext
text/x-wiki
#重定向 [[杰茜·伊芙莉娅]]
1ab228b4f067acacf0ec031d88407255f5f81326
洛基
0
571
1742
2023-03-11T12:00:20Z
Pio
2
重定向页面至[[洛基·伊芙莉娅]]
wikitext
text/x-wiki
#重定向 [[洛基·伊芙莉娅]]
f826c71fe98a16754d950e0b39d205dfabac42d9
文件:地图2023 .jpg
6
572
1743
2023-03-11T13:46:53Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:Z$166NQ3@J YT~SQ$`YL9YB.png
6
574
1745
2023-03-11T13:53:05Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
2023“井”上添花
0
575
1746
2023-03-11T13:53:52Z
Pio
2
重定向页面至[[2023井盖]]
wikitext
text/x-wiki
#重定向 [[2023井盖]]
6e4961b0175f17ce931e8622cc5b4883431cf804
2023井盖
0
576
1747
2023-03-11T13:54:21Z
Pio
2
Loli移动页面[[2023井盖]]至[[2023井上添花]],覆盖重定向
wikitext
text/x-wiki
#重定向 [[2023井上添花]]
22d755c1c722171a84dbc6b865fd8da698727dcf
红茶维基:关于
4
521
1692
2023-03-12T01:54:05Z
Pio
2
wikitext
text/x-wiki
__NOTOC__
红茶维基,红茶社百科全书。
== 历史 ==
* 于2022.2由[[用户:Loli]]创建。
* 由于数据库问题,在2022.5站点被重置。
* 2022.5 站点由1.37.1更新到1.37.2
* 2023.2 站点由1.37.2更新到1.39.1(LTS系列版本)
* 2023.2 Mediawiki1.39.1 -> 1.39.2, PHP 7.4 -> 8.2
f353a80d87054f0faa3db29e1db1be21a83d88d1
2023井上添花
0
573
1744
2023-03-12T02:46:12Z
Pio
2
wikitext
text/x-wiki
[[文件:地图2023 .jpg|缩略图|替代=井盖地图|井盖地图]]
== 简介 ==
2023“井”上添花{{黑幕|井盖上瞎画}}活动。
参加同学:全体同学(高一每班3-4组,高二每班1-2组、高三自愿)
活动于3.5前报名结束并提交草稿,3.12前审核完毕并通知结果。3.30绘画完毕。
感谢[[小火龙]]老师绘制的井盖标号地图。
== 相关规则 ==
[[File:Z$166NQ3@J_YT~SQ$`YL9YB.png|400px]]
52ecc98df08db4daedda907a2fe9e29deb617397
首页
0
1
1748
1
2023-03-12T02:48:16Z
Pio
2
重定向页面至[[Main Page]]
wikitext
text/x-wiki
#重定向 [[Main Page]]
98a7b064fd6f5deced355ed7ac8db2ff53a02f42
主页
0
577
1749
2023-03-12T02:48:26Z
Pio
2
重定向页面至[[Main Page]]
wikitext
text/x-wiki
#重定向 [[Main Page]]
98a7b064fd6f5deced355ed7ac8db2ff53a02f42
MediaWiki:Sitenotice
8
528
1699
2023-03-12T03:59:31Z
Pio
2
清空全部内容
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
用户:Loli/old vector.css
2
579
1751
2023-03-12T04:18:54Z
Pio
2
创建页面,内容为“/*全站背景*/ body { background-image: url(/images/f/f4/Sakura.png); opacity: 0.87; background-position: center top; background-size: auto; background-repeat: repeat; background-attachment: fixed; } /* 黑幕 */ .heimu, .heimu a, a .heimu, .heimu a.new { background-color: #252525; color: #252525; text-shadow: none; } .heimu:hover, .heimu:active, .heimu:hover .heimu, .heimu:active .heimu { color: white !important; } .heimu:hover…”
css
text/css
/*全站背景*/
body {
background-image: url(/images/f/f4/Sakura.png);
opacity: 0.87;
background-position: center top;
background-size: auto;
background-repeat: repeat;
background-attachment: fixed;
}
/* 黑幕 */
.heimu, .heimu a, a .heimu, .heimu a.new {
background-color: #252525;
color: #252525;
text-shadow: none;
}
.heimu:hover, .heimu:active,
.heimu:hover .heimu, .heimu:active .heimu {
color: white !important;
}
.heimu:hover a, a:hover .heimu,
.heimu:active a, a:active .heimu {
color: lightblue !important;
}
.heimu:hover .new, .heimu .new:hover, .new:hover .heimu,
.heimu:active .new, .heimu .new:active, .new:active .heimu {
color: #BA0000 !important;
}
/* 划掉 */
.mw-body del{
text-decoration:line-through;
color:#A9A9A9;
}
/* 标题 */
.mw-headline,.firstHeading{
font-family:"Consolas","微软雅黑","Microsoft Yahei" !important;
}
.firstHeading{
font-weight: 500;
padding-bottom: 6px;
font-size: 170%;
}
.mw-headline{
color: #404040 !important;
line-height: 1.8 !important;
border-bottom-color: rgba(0, 0, 0, .1) !important;
}
.mw-body-content h2 {
font-weight: 540;
margin-bottom: 0.3em;
}
#siteSub {
display: inline;
font-size: 100%;
font-weight: 400; /* 400 = normal */
font-style: normal;
text-align: right;
padding-top: 11px;
padding: 0.1em;
}
/*全站样式*/
body {
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
.mw-body {
margin-left: 10.94em;
}
.mw-body-content {
line-height: 1.85;
}
.mw-label {
white-space: nowrap;
}
body .ui-dialog .ui-widget-header {
background: #f1f1f1 !important;
}
body .ui-button {
box-shadow: 0 0 0 0 !important;
}
/* h2 title */
.ns-0 h2 {
overflow: visible;
border-bottom: none;
}
.ns-0 h2 .mw-headline {
display: inline-block;
padding: 0.7px 0;
}
.ns-0 h2 .mw-headline::after {
content: '';
display: block;
background-color: #ff6d6d73;
height: 0.7em;
margin: -0.7em 0 0 -0.5em;
width: 100%;
border-radius: 0.35em;
}
::selection {
background: rgba(0,0,0,.1);
text-shadow: none;
}
::-webkit-scrollbar {
height: 10px;
width: 10px;
}
::-webkit-scrollbar-thumb {
background: rgb(213, 213, 213);
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: rgb(196, 196, 196);
}
/* 链接显示效果 */
a, a:visited {
text-decoration: none!important;
color: #3266cc;
}
a.new {
color: #BA0000!important;
}
.mw-body a.external:visited {
color: #3366cc!important;
}
/* 侧边栏、顶部栏、页脚 */
.mw-body {
padding: 37px;
border: none;
}
.vectorTabs {
font-size: 16px;
padding-top: 2px;
}
.vectorTabs #ca-unwatch.icon a, .vectorTabs #ca-watch.icon a, .vectorTabs #ca-wikilove.icon a {
padding-top: 3.4em;
}
.vectorMenuCheckbox {
height:110%;
}
.portal {
background: transparent !important;
}
#mw-panel {
padding-left: 0em;
}
#mw-head {
background-color: rgb(254,254,254);
min-height: 103.5px;
opacity: 1.0;
transition-property: opacity !important;
transition-duration: 0.25s !important;
}
.vectorMenu {
font-size: 92%;
}
#p-cactions-label {
height: 2.7em !important;
}
#mw-head:hover {
opacity: 1.0 !important;
}
.uls-settings-trigger {
display: none !important;
}
#left-navigation {
margin-left: 200px;
}
#mw-page-base {
height: 104px;
}
#left-navigation,
#right-navigation {
margin-top: 61px;
}
#mw-head div.vectorMenu h4 {
height: 1.9em;
margin-bottom: 0;
padding-top: 1.25em;
padding-bottom: 0;
padding-right: 0.5em;
}
#mw-panel div.portal {
padding-bottom: 0.7em;
padding-top: 0.4em;
}
#mw-panel {
font-size: 17.5px;
}
#mw-head li {
background: transparent !important;
}
#mw-head{
box-shadow: 0 7px 10px 0 rgba(0,0,0,0.06);
z-index: 2;
line-height: 1.7 !important;
font-weight: 300 !important;
}
#mw-panel {
z-index: 2;
line-height: 1.7 !important;
font-weight: 300 !important;
}
#mw-panel .portal .body li {
line-height: 1.6em;
}
.mw-wiki-logo{
padding-left: 5px !important;
padding-top: 10px !important;
border: none !important;
}
.clear-div {
clear: both;
}
.uls-trigger{
display: none;
}
div.vectorMenu div.menu {
top: 2.8em;
width: 100%;
background-color: rgba(251,251,251,0.9);
border: 1px solid #a7d7f9;
border-top: transparent;
}
#mw-panel .portal .body li a:visited {
color: #0645ad;
}
#mw-head .portal .body li a:visited {
color: #0645ad;
}
#ca-conv{
float: right;
}
#catlinks {
background-color: rgba(251,251,251,0.3);
}
.oo-ui-popupWidget-anchored-top {
z-index: 10000;
}
#mp-banner {
margin: -3.2em;
margin-top: -6em;
}
#footer {
margin-left: 12.4em;
padding: 1.25em;
}
/* 最近更改页面 */
.mw-changeslist-legend {
display: block!important;
}
/* 编辑历史调整*/
#pagehistory li.selected {
background-color: transparent;
}
/* 编辑区帮助 */
.editHelp {
display: inline-block!important;
}
/* 隐藏编辑提示修改和上传文件协议 */
div.sysop-show, p.sysop-show {
display: none;
}
.mw-htmlform-field-Licenses{
display: none;
}
.oo-ui-panelLayout-scrollable {
overflow: hidden;
}
/* 斜体字右边距加大看以防止文字挤在一起 */
#mw-content-text i {
margin-right: 3px;
}
/* 数据表格 */
.mw-datatable.TablePager {
line-height: 1.7;
width: 100%;
table-layout: fixed;
word-wrap: break-word;
}
#siteSub
{
display: none;
}
.mw-mmv-filepage-buttons .mw-mmv-view-expanded, .mw-mmv-filepage-buttons .mw-mmv-view-config {
display: none;
}
/* 目录 */
#toc{
display: block;
position: fixed;
right: 0;
overflow-y: scroll;
padding-top: 1em;
overflow: hidden;
background: rgb(254,254,254,0.95);
box-shadow: 0 4px 9px 0 rgb(0 0 0 / 7.5%);
border: none;
top: 55px;
width: 139px;
transition: all .4s ease;
}
.toctitle {
background-color: rgb(245,245,245,0.3);
padding: 7px;
}
#toc:hover {
opacity: 1;
}
#toc>ul {
padding-bottom: 10px!important;
height: 71.7vh;
overflow-y: scroll;
transition: none;
}
#btn-showtoc {
cursor: pointer;
}
#toc .toctoggle {
display: none;
}
@media screen and (min-width: 1300px) {
#toc {
width: 176px;
}
.ns-0 #toc,.ns-5 #toc {
opacity: 1 !important;
background-color: rgb(254,254,254);
padding: 1.5em;
padding-left: 2.3em;
}
.ns-0 #toc > ul, .ns-5 #toc > ul{
line-height: 2.1em;
margin-top: 10px;
}
.ns-0 #toc,.ns-5 #toc {
width: 165px;
top: 103px;
left: auto;
right: -7px;
}
}
@media screen and (min-width: 1700px) {
#toc{
top: 95px;
left: auto;
right: -6px;
}
}
/* 表格宽度 */
.wikitable {
max-width: 100%;
}
/* 缩略图居中*/
.thumb.tcenter {
float: none;
clear: both;
display: block;
margin: 0 auto;
}
/* 图片外框 */
.thumbinner {
border: 1px solid #f8f9fa !important;
border-radius: 3px !important;
overflow: hidden !important;
}
.magnify a {
pointer-events: none;
}
/* 图库样式 */
li.gallerybox div.thumb {
border: 1px solid #f8f9fa;
}
.thumbimage {
border: 0px !important;
}
.thumbcaption {
margin: 7px 0px !important;
}
.thumbimage:hover {
opacity: 0.9 !important;
}
.dablink {
margin: 14px 0px !important;
font-weight: 300 !important;
font-size: 17.5px !important;
}
.ambox,.tmbox,.Note,.informationbox {
margin: 5px 0px !important;
font-size: 18px !important;
font-weight: 700 !important;
line-height: 1.5 !important;
border: 1px dashed #aaa !important;
max-width: 550px !important;
font-weight: 300 !important;
}
.ambox td,.tmbox td {
padding: 10px !important;
}
.ambox-text-small,.mbox-text,.Note td {
font-size: 14px !important;
font-weight: 300 !important;
color: #000 !important;
}
#request_for_deletion,.ambox-serious {
background: rgba(255,0,0,0.1) !important;
border: 1px dashed rgba(255,0,0,0.15) !important;
color: #a00000 !important;
}
.tmbox-notice,.tmbox-move,.Note {
background: rgba(150,75,0,0.1) !important;
border: 1px dashed rgba(150,75,0,0.15) !important;
}
.informationbox {
background: #fff !important;
padding: 10px !important;
font-size: 14px !important;
}
.editOptions {
border: 0px !important;
}
.image img:hover {
opacity: 0.85 !important;
}
/* 编辑请求 */
.editRequest {
text-align: center;
border: 1px solid #ddd;
border-radius: 3px;
margin:1em 2.5em;
padding: 1em;
background: white;
}
.editRequest .newComment {
white-space: nowrap;
background: #347bff;
color: #fff;
border: 1px solid #347bff;
text-shadow: 0 1px rgba(0,0,0,0.1);
font-family: inherit;
font-size: 1em;
min-width: 4em;
max-width: 28.75em;
padding: .5em 1em;
margin: 0;
border-radius: 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-appearance: none;
zoom: 1;
vertical-align: middle;
text-align: center;
font-weight: bold;
cursor: pointer;
}
/* 注释里的列表 */
.reference-text > ul.listInRef,
.reference-text > ol.listInRef {
margin: -1.5em 0 0 2em;
}
/*
* Skeleton V2.0.4
* Copyright 2014, Dave Gamache
* www.getskeleton.com
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 12/29/2014
*/
/* 以下内容已被萌百格式化,注释已被翻译 */
.container {
position: relative;
width: 100%;
max-width: 960px;
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
.div,
.divs,
.column,
.columns {
width: 100%;
float: left;
box-sizing: border-box;
}
/* 适配超窄屏 */
@media (min-width: 400px) {
.container {
width: 85%;
padding: 0;
}
}
/* 适配窄屏 */
@media (min-width: 860px) {
.container {
width: 80%;
}
.div,
.divs,
.column,
.columns {
margin-left: .3%;
}
.div:first-child,
.divs:first-child,
.column:first-child,
.columns:first-child {
margin-left: 0;
}
.one.div,
.one.divs {
width: 100%;
margin-left: 0;
}
.two.divs {
width: 49.85%;
}
.three.divs {
width: 33.1333333333%;
}
.four.divs {
width: 24.775%;
}
.five.divs {
width: 19.76%;
}
.six.divs {
width: 16.4166666667%;
}
.seven.divs {
width: 14.0285714286%;
}
.eight.divs {
width: 12.2375%;
}
.nine.divs {
width: 10.8444444444%;
}
.ten.divs {
width: 9.73%;
}
.eleven.divs {
width: 8.81818181818%;
}
.twelve.divs {
width: 8.05833333333%;
}
.one.column,
.one.columns {
width: 8.05833333333%;
}
.two.columns {
width: 16.4166666667%;
}
.three.columns {
width: 24.775%;
}
.four.columns {
width: 33.1333333333%;
}
.five.columns {
width: 41.4916666667%;
}
.six.columns {
width: 49.85%;
}
.seven.columns {
width: 58.2083333333%;
}
.eight.columns {
width: 66.5666666667%;
}
.nine.columns {
width: 74.925%;
}
.ten.columns {
width: 83.2833333333%;
}
.eleven.columns {
width: 91.6416666667%;
}
.twelve.columns {
width: 100%;
margin-left: 0;
}
.one-third.column {
width: 33.1333333333%;
}
.two-thirds.column {
width: 66.5666666667%;
}
.one-half.column {
width: 49.85%;
}
/* Offsets设置 */
.offset-by-one.column,
.offset-by-one.columns {
margin-left: 8.66666666667%;
}
.offset-by-two.column,
.offset-by-two.columns {
margin-left: 17.3333333333%;
}
.offset-by-three.column,
.offset-by-three.columns {
margin-left: 26%;
}
.offset-by-four.column,
.offset-by-four.columns {
margin-left: 34.6666666667%;
}
.offset-by-five.column,
.offset-by-five.columns {
margin-left: 43.3333333333%;
}
.offset-by-six.column,
.offset-by-six.columns {
margin-left: 52%;
}
.offset-by-seven.column,
.offset-by-seven.columns {
margin-left: 60.6666666667%;
}
.offset-by-eight.column,
.offset-by-eight.columns {
margin-left: 69.3333333333%;
}
.offset-by-nine.column,
.offset-by-nine.columns {
margin-left: 78.0%;
}
.offset-by-ten.column,
.offset-by-ten.columns {
margin-left: 86.6666666667%;
}
.offset-by-eleven.column,
.offset-by-eleven.columns {
margin-left: 95.3333333333%;
}
.offset-by-one-third.column,
.offset-by-one-third.columns {
margin-left: 34.6666666667%;
}
.offset-by-two-thirds.column,
.offset-by-two-thirds.columns {
margin-left: 69.3333333333%;
}
.offset-by-one-half.column,
.offset-by-one-half.columns {
margin-left: 52%;
}
}
/* 适配平板 */
@media all and (max-width: 1024px) {
body {
font-size: 93%;
}
.mw-body {
margin-left: 11.8em;
}
#sidebarHidden-arrow {
left: 11em;
}
table.navbox {
font-size: 103%;
}
}
/* 适配宽屏 */
@media screen and (min-width: 1300px) {
body {
font-size: 107%;
}
.oo-ui-window-content {
font-size: 89.3%;
}
#mw-panel {
padding-left: 11.6px !important;
width: 200px !important;
}
#p-logo {
left: 0px;
padding-left: 2px;
}
#left-navigation {
margin-left: 237px !important;
}
.mw-body {
margin-left: 12.4em;
padding-left: 49px;
padding-right: 49px;
padding-top: 31px;
box-shadow: 0 0 0.5rem rgb(0 0 0 / 7%);
}
#localNotice {
padding-bottom: 13px;
margin-bottom: 1.4em;
}
.ns-0:not(.page-Main_Page) #content, .ns-0:not(.page-Main_Page) #footer, .ns-5 #content, .ns-5 #footer{
margin-left: 12.4em;
margin-right: 12.4em;
}
.ns-0:not(.page-Main_Page) .mw-body, .ns-5 .mw-body {
padding-left: 39px;
padding-right: 39px;
}
#sidebarHidden-arrow {
display: none;
}
}
/* 适配带鱼屏 */
@media screen and (min-width: 1800px) {
#content,#footer {
max-width: 71em;
margin-left: auto !important;
margin-right: auto !important;
}
}
/* vectorMenu 的排序 */
div.vectorMenu ul {
display: flex;
flex-flow: column;
}
/* 分类页同开头的页面的列表不分段 */
.mw-category-group {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid;
}
.mw-category-group:nth-child(1):nth-last-child(1), /* 只有一个列表时 */
.mw-category-group:nth-child(1):nth-last-child(2), /* 只有两个列表时 */
.mw-category-group:nth-child(2):nth-last-child(1) { /* 只有两个列表时 */
-webkit-column-break-inside: auto;
page-break-inside: auto;
break-inside: auto;
}
h3 .mw-headline:before{
content: "#";
color: #ff6d6d;
font-size: 1.3em;
margin-right: .5em;
}
661e4f9c347ad2f79931825d55e948bb4b6c0760
用户:Loli/vector 2022.css
2
580
1752
2023-03-12T04:19:19Z
Pio
2
创建页面,内容为“/* h2 title */ .ns-0 h2 { overflow: visible; border-bottom: none; } .ns-0 h2 .mw-headline { display: inline-block; padding: 0.7px 0; } .ns-0 h2 .mw-headline::after { content: ''; display: block; background-color: #ff6d6d73; height: 0.7em; margin: -0.7em 0 0 -0.5em; width: 100%; border-radius: 0.35em; } ::selection { background: rgba(0,0,0,.1); text-shadow: none; } ::-webkit-scrollbar { height: 10px; width: 10px; } ::-webkit-scrollbar-thum…”
css
text/css
/* h2 title */
.ns-0 h2 {
overflow: visible;
border-bottom: none;
}
.ns-0 h2 .mw-headline {
display: inline-block;
padding: 0.7px 0;
}
.ns-0 h2 .mw-headline::after {
content: '';
display: block;
background-color: #ff6d6d73;
height: 0.7em;
margin: -0.7em 0 0 -0.5em;
width: 100%;
border-radius: 0.35em;
}
::selection {
background: rgba(0,0,0,.1);
text-shadow: none;
}
::-webkit-scrollbar {
height: 10px;
width: 10px;
}
::-webkit-scrollbar-thumb {
background: rgb(213, 213, 213);
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: rgb(196, 196, 196);
}
.mw-headline{
color: #404040 !important;
line-height: 1.8 !important;
border-bottom-color: rgba(0, 0, 0, .1) !important;
}
#siteSub {
display: inline;
font-size: 100%;
font-weight: 400; /* 400 = normal */
font-style: normal;
text-align: right;
padding-top: 11px;
padding: 0.1em;
}
/*全站样式*/
body {
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
/* 斜体字右边距加大看以防止文字挤在一起 */
#mw-content-text i {
margin-right: 3px;
}
/* 数据表格 */
.mw-datatable.TablePager {
line-height: 1.7;
width: 100%;
table-layout: fixed;
word-wrap: break-word;
}
#siteSub
{
display: none;
}
.mw-mmv-filepage-buttons .mw-mmv-view-expanded, .mw-mmv-filepage-buttons .mw-mmv-view-config {
display: none;
}
/* 表格宽度 */
.wikitable {
max-width: 100%;
}
/* 缩略图居中*/
.thumb.tcenter {
float: none;
clear: both;
display: block;
margin: 0 auto;
}
/* 图片外框 */
.thumbinner {
border: 1px solid #f8f9fa !important;
border-radius: 3px !important;
overflow: hidden !important;
}
.magnify a {
pointer-events: none;
}
/* 隐藏 切换到旧外观 按钮 */
.mw-sidebar div.mw-sidebar-action {
display: none;
}
/* 三级标题特别样式 */
h3 .mw-headline:before{
content: "#";
color: #ff6d6d;
font-size: 1.2em;
margin-right: .5em;
}
439c07bb6e03431fbcefc3571e7f6d672a105225
模板:Documentation/doc
10
586
1758
2023-03-12T05:32:28Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<!--此模板还在汉化中-->
{{Documentation}}
'''documentation'''模板是在template/module文档中转录的。这个模板应该只用在标题中带有"doc"的模板。
==用法==
将{{t|documentation}}放在文档页面的顶部。
If the page to be documented is a subpage, use {{t|documentation|pagename of page to be documented}} at the top of the documentation page. For example, Template:Foo/bar's documentation page would use {{t|documentation|Template:Foo/bar}}.
The template will attempt to auto detect and link <code><nowiki>{{#Invoke:}}</nowiki></code> calls on template documentations or the <code>require()</code>/<code>mw.loadData()</code> depedency list on module documentations. If you want to supress the auto generated dependency list, use {{t|documentation|DependencyList=no}}
==提示==
这个模板链接到一个/doc,可能看起来毫无用处,然而,它的存在是为了将导航框和用户框链接到其基础模板的文档。
<includeonly></includeonly>
==TemplateData==
<templatedata>
{
"params": {},
"description": "The documentation template is transcluded in the template/module documentation. This template should only be used on subpages titled \"doc\"."
}
</templatedata>
91862ad75ef025763f21e7660a12834f51f2ffb3
模块:Documentation/doc
828
588
1760
2023-03-12T05:34:48Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
'''Module:Documentation''' implements [[Template:Documentation]] for templates and modules.
fd57b376de6402fa14b7b248ff8c8c3bed41eabe
模块:Enum
828
592
1764
2023-03-12T05:34:49Z
Pio
2
导入1个版本
Scribunto
text/plain
-- <nowiki> awawa
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
local p = {}
p.__index = p
setmetatable(p, {
__call = function(_, enum)
return p.new(enum)
end
})
function p.__tostring(enum)
local dumpObject = require('Module:Logger').dumpObject
setmetatable(enum, nil)
return dumpObject(enum, {clean=true, collapseLimit=100})
end
function p.__concat(lhs, rhs)
if type(lhs) == 'table' and type(rhs) == 'table' then
return p.insert(lhs, rhs)
else
return tostring(lhs) .. tostring(rhs)
end
end
function p.__unm(enum)
return p.map(enum, function(x) return -x end)
end
local function mathTemplate(lhs, rhs, funName, fun)
checkTypeMulti('Module:Enum.' .. funName, 1, lhs, {'number', 'table'})
checkTypeMulti('Module:Enum.' .. funName, 2, rhs, {'number', 'table'})
local res = setmetatable({}, getmetatable(lhs) or getmetatable(rhs))
if type(lhs) == 'number' or type(rhs) == 'number' then
local scalar, vector
if type(lhs) == 'number' then
scalar = lhs
vector = rhs
else
scalar = rhs
vector = lhs
end
for i = 1, #vector do
res[i] = fun(vector[i], scalar)
end
else
assert(#lhs == #rhs, 'Tables are not equal length')
for i = 1, #lhs do
res[i] = fun(lhs[i], rhs[i])
end
end
return res
end
function p.__add(lhs, rhs)
return mathTemplate(lhs, rhs, '__add', function(x, y) return x + y end)
end
function p.__sub(lhs, rhs)
return mathTemplate(lhs, rhs, '__sub', function(x, y) return x - y end)
end
function p.__mul(lhs, rhs)
return mathTemplate(lhs, rhs, '__mul', function(x, y) return x * y end)
end
function p.__div(lhs, rhs)
return mathTemplate(lhs, rhs, '__div', function(x, y) return x / y end)
end
function p.__pow(lhs, rhs)
return mathTemplate(lhs, rhs, '__pow', function(x, y) return x ^ y end)
end
function p.__lt(lhs, rhs)
for i = 1, math.min(#lhs, #rhs) do
if lhs[i] >= rhs[i] then
return false
end
end
return true
end
function p.__le(lhs, rhs)
for i = 1, math.min(#lhs, #rhs) do
if lhs[i] > rhs[i] then
return false
end
end
return true
end
function p.__eq(lhs, rhs)
if #lhs ~= #rhs then
return false
end
for i = 1, #lhs do
if lhs[i] ~= rhs[i] then
return false
end
end
return true
end
function p.all(enum, fn, clone)
checkType('Module:Enum.all', 1, enum, 'table')
checkType('Module:Enum.all', 2, fn, 'function', true)
checkType('Module:Enum.all', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
fn = fn or function(item) return item end
local i = 1
while enum[i] ~= nil do
if not fn(enum[i], i) then
return false
end
i = i + 1
end
return true
end
function p.any(enum, fn, clone)
checkType('Module:Enum.any', 1, enum, 'table')
checkType('Module:Enum.any', 2, fn, 'function', true)
checkType('Module:Enum.any', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
fn = fn or function(item) return item end
local i = 1
while enum[i] ~= nil do
if fn(enum[i], i) then
return true
end
i = i + 1
end
return false
end
function p.contains(enum, elem, clone)
checkType('Module:Enum.contains', 1, enum, 'table')
checkType('Module:Enum.contains', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum); elem = mw.clone(elem) end
return p.any(enum, function(item) return item == elem end)
end
function p.each(enum, fn, clone)
checkType('Module:Enum.each', 1, enum, 'table')
checkType('Module:Enum.each', 2, fn, 'function')
checkType('Module:Enum.each', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
local i = 1
while enum[i] ~= nil do
fn(enum[i], i)
i = i + 1
end
end
function p.filter(enum, fn, clone)
checkType('Module:Enum.filter', 1, enum, 'table')
checkType('Module:Enum.filter', 2, fn, 'function', true)
checkType('Module:Enum.filter', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
fn = fn or function(item) return item end
local r = setmetatable({}, getmetatable(enum))
local len = 0
local i = 1
while enum[i] ~= nil do
if fn(enum[i], i) then
len = len + 1
r[len] = enum[i]
end
i = i + 1
end
return r
end
function p.find(enum, fn, default, clone)
checkType('Module:Enum.find', 1, enum, 'table')
checkType('Module:Enum.find', 2, fn, 'function')
checkType('Module:Enum.find', 4, clone, 'boolean', true)
if clone then enum = mw.clone(enum); default = mw.clone(default) end
local i = 1
while enum[i] ~= nil do
if fn(enum[i], i) then
return enum[i], i
end
i = i + 1
end
return default
end
function p.find_index(enum, fn, default, clone)
checkType('Module:Enum.find_index', 1, enum, 'table')
checkType('Module:Enum.find_index', 2, fn, 'function')
checkType('Module:Enum.find_index', 4, clone, 'boolean', true)
if clone then enum = mw.clone(enum); default = mw.clone(default) end
fn = fn or function(item) return item end
local i = 1
while enum[i] ~= nil do
if fn(enum[i], i) then
return i
end
i = i + 1
end
return default
end
function p.newIncrementor(start, step)
checkType('Module:Enum.newIncrementor', 1, start, 'number', true)
checkType('Module:Enum.newIncrementor', 2, step, 'number', true)
step = step or 1
local n = (start or 1) - step
local obj = {}
return setmetatable(obj, {
__call = function() n = n + step return n end,
__tostring = function() return n end,
__index = function() return n end,
__newindex = function(self, k, v)
if k == 'step' and type(v) == 'number' then
step = v
elseif type(v) == 'number' then
n = v
end
end,
__concat = function(x, y) return tostring(x) .. tostring(y) end
})
end
function p.intersect(enum1, enum2, clone)
checkType('Module:Enum.intersect', 1, enum1, 'table')
checkType('Module:Enum.intersect', 2, enum2, 'table')
checkType('Module:Enum.intersect', 3, clone, 'boolean', true)
if clone then enum1 = mw.clone(enum1); enum2 = mw.clone(enum2) end
local enum2Elements = {}
local res = setmetatable({}, getmetatable(enum1) or getmetatable(enum2))
local len = 0
p.each(enum2, function(item) enum2Elements[item] = true end)
p.each(enum1, function(item)
if enum2Elements[item] then
len = len + 1
res[len] = item
end
end)
return res
end
function p.intersects(enum1, enum2, clone)
checkType('Module:Enum.intersects', 1, enum1, 'table')
checkType('Module:Enum.intersects', 2, enum2, 'table')
checkType('Module:Enum.intersects', 3, clone, 'boolean', true)
if clone then enum1 = mw.clone(enum1); enum2 = mw.clone(enum2) end
local small = {}
local large
if #enum1 <= #enum2 then
p.each(enum1, function(item) small[item] = true end)
large = enum2
else
p.each(enum2, function(item) small[item] = true end)
large = enum1
end
return p.any(large, function(item) return small[item] end)
end
function p.insert(enum1, enum2, index, clone)
checkType('Module:Enum.insert', 1, enum1, 'table')
checkType('Module:Enum.insert', 2, enum2, 'table')
checkType('Module:Enum.insert', 3, index, 'number', true)
checkType('Module:Enum.insert', 4, clone, 'boolean', true)
if clone then enum1 = mw.clone(enum1); enum2 = mw.clone(enum2) end
local len1 = #enum1
local len2 = #enum2
index = index or (len1 + 1)
local res = setmetatable({}, getmetatable(enum1) or getmetatable(enum2))
for i = 1, (len1 + len2) do
if i < index then
res[i] = enum1[i]
elseif i < (index + len2) then
res[i] = enum2[i - index + 1]
else
res[i] = enum1[i - len2]
end
end
return res
end
function p.map(enum, fn, clone)
checkType('Module:Enum.map', 1, enum, 'table')
checkType('Module:Enum.map', 2, fn, 'function')
checkType('Module:Enum.map', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
local len = 0
local r = setmetatable({}, getmetatable(enum))
local i = 1
while enum[i] ~= nil do
local tmp = fn(enum[i], i)
if tmp ~= nil then
len = len + 1
r[len] = tmp
end
i = i + 1
end
return r
end
function p.max_by(enum, fn, clone)
checkType('Module:Enum.max_by', 1, enum, 'table')
checkType('Module:Enum.max_by', 2, fn, 'function')
checkType('Module:Enum.max_by', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
return unpack(p.reduce(enum, function(new, old)
local y = fn(new)
return y > old[2] and {new, y} or old
end, {enum[1], -math.huge}))
end
function p.new(enum)
for _, v in pairs(enum) do
if type(v) == 'table' then
p.new(v)
end
end
if getmetatable(enum) == nil then
setmetatable(enum, p)
end
return enum
end
function p.range(start, stop, step)
checkType('Module:Enum.range', 1, start, 'number')
checkType('Module:Enum.range', 2, stop, 'number', true)
checkType('Module:Enum.range', 3, step, 'number', true)
local array = setmetatable({}, p)
local len = 0
if not stop then
stop = start
start = 1
end
for i = start, stop, step or 1 do
len = len + 1
array[len] = i
end
return array
end
function p.reduce(enum, fn, accumulator, clone)
checkType('Module:Enum.reduce', 1, enum, 'table')
checkType('Module:Enum.reduce', 2, fn, 'function')
checkType('Module:Enum.reduce', 4, clone, 'boolean', true)
if clone then enum = mw.clone(enum); accumulator = mw.clone(accumulator) end
local acc = accumulator
local i = 1
while enum[i] ~= nil do
if i == 1 and not accumulator then
acc = enum[i]
else
acc = fn(enum[i], acc)
end
i = i + 1
end
return acc
end
function p.reject(enum, fn, clone)
checkType('Module:Enum.reject', 1, enum, 'table')
checkTypeMulti('Module:Enum.reject', 2, fn, {'function', 'table', 'nil'})
checkType('Module:Enum.reject', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
fn = fn or function(item) return item end
local r = setmetatable({}, getmetatable(enum))
local len = 0
if type(fn) == 'function' then
local i = 1
while enum[i] ~= nil do
if not fn(enum[i], i) then
len = len + 1
r[len] = enum[i]
end
i = i + 1
end
else
local rejectMap = {}
p.each(fn, function(item) rejectMap[item] = true end)
local i = 1
while enum[i] ~= nil do
if not rejectMap[enum[i]] then
len = len + 1
r[len] = enum[i]
end
i = i + 1
end
end
return r
end
function p.rep(val, n, clone)
checkType('Module:Enum.rep', 2, n, 'number')
checkType('Module:Enum.reject', 3, clone, 'boolean', true)
if clone then val = mw.clone(val) end
local r = setmetatable({}, p)
for i = 1, n do
r[i] = val
end
return r
end
function p.scan(enum, fn, accumulator, clone)
checkType('Module:Enum.scan', 1, enum, 'table')
checkType('Module:Enum.scan', 2, fn, 'function')
checkType('Module:Enum.scan', 4, clone, 'boolean', true)
if clone then enum = mw.clone(enum); accumulator = mw.clone(accumulator) end
local acc = accumulator
local r = setmetatable({}, getmetatable(enum))
local i = 1
while enum[i] ~= nil do
if i == 1 and not accumulator then
acc = enum[i]
else
acc = fn(enum[i], acc)
end
r[i] = acc
i = i + 1
end
return r
end
function p.slice(enum, start, finish, clone)
checkType('Module:Enum.slice', 1, enum, 'table')
checkType('Module:Enum.slice', 2, start, 'number', true)
checkType('Module:Enum.slice', 3, finish, 'number', true)
checkType('Module:Enum.slice', 4, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
start = start or 1
finish = finish or #enum
local r = setmetatable({}, getmetatable(enum))
local len = 0
for i = start, finish do
len = len + 1
r[len] = enum[i]
end
return r
end
function p.split(enum, count, clone)
checkType('Module:Enum.split', 1, enum, 'table')
checkType('Module:Enum.split', 2, count, 'number')
checkType('Module:Enum.split', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
if #enum < count then
return enum, {}
elseif count < 1 then
return {}, enum
end
local x = setmetatable({}, getmetatable(enum))
local y = setmetatable({}, getmetatable(enum))
for i = 1, #enum do
table.insert(i <= count and x or y, enum[i])
end
return x, y
end
function p.sum(enum, clone)
checkType('Module:Enum.sum', 1, enum, 'table')
checkType('Module:Enum.sum', 2, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
return p.reduce(enum, function(x, y) return x + y end)
end
function p.take(enum, count, clone)
checkType('Module:Enum.take', 1, enum, 'table')
checkType('Module:Enum.take', 2, count, 'number')
checkType('Module:Enum.take', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
local x, _ = p.split(enum, count)
return x
end
function p.take_every(enum, n, clone)
checkType('Module:Enum.take_every', 1, enum, 'table')
checkType('Module:Enum.take_every', 2, n, 'number')
checkType('Module:Enum.take_every', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
local r = setmetatable({}, getmetatable(enum))
local len = 0
local i = 1
while enum[i] ~= nil do
if (i - 1) % n == 0 then
len = len + 1
r[len] = enum[i]
end
i = i + 1
end
return r
end
function p.unique(enum, fn, clone)
checkType('Module:Enum.unique', 1, enum, 'table')
checkType('Module:Enum.unique', 2, fn, 'function', true)
checkType('Module:Enum.unique', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
fn = fn or function(item) return item end
local r = setmetatable({}, getmetatable(enum))
local len = 0
local hash = {}
local i = 1
while enum[i] ~= nil do
local id = fn(enum[i])
if not hash[id] then
len = len + 1
r[len] = enum[i]
hash[id] = true
end
i = i + 1
end
return r
end
function p.zip(enums, clone)
checkType('Module:Enum.zip', 1, enums, 'table')
checkType('Module:Enum.zip', 2, clone, 'boolean', true)
if clone then enums = mw.clone(enums) end
local r = setmetatable({}, getmetatable(enums))
local _, longest = p.max_by(enums, function(enum) return #enum end)
for i = 1, longest do
local q = {}
for j = 1, #enums do
table.insert(q, enums[j][i])
end
table.insert(r, q)
end
return r
end
return p
-- </nowiki>
1e11aa4fa5a345c57a4f4012d7268a67f7dfeaff
模板:Note/doc
10
600
1772
2023-03-12T06:00:07Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{t|Note}} is a simple notice template intended for use posting editorial notes in articles. Particularly comm-links.
Expects a single anonymous parameter that is the bulk of the comment. Creates styled box but no boiler plate text for simple translations.
Note that the user should supply a short bolded description of what kind of editorial note this is.
;Sample Output:
<nowiki>{{Note|'''Note:''' This is an editorial comment.}}</nowiki>
;Results in:
{{Note|'''Note:''' This is an editorial comment.}}
;Sample Output:
<nowiki>{{Note|'''Errata:''' Correction to this comm-link (include reference to source).}}</nowiki>
;Results in:
{{Note|'''Errata:''' Correction to this comm-link (include reference to source).}}
<includeonly>[[Category:General wiki templates|{{PAGENAME}}]]</includeonly>
f02dac8496615558dfcb321941cee98c58b0310e
模板:T
10
584
1756
2023-03-12T06:43:42Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly><nowiki>{{</nowiki>[[Template:{{{1}}}|{{{1}}}]]{{t/piece|{{{2|---}}}}}{{t/piece|{{{3|---}}}}}{{t/piece|{{{4|---}}}}}{{t/piece|{{{5|---}}}}}{{t/piece|{{{6|---}}}}}{{t/piece|{{{7|---}}}}}{{t/piece|{{{8|---}}}}}{{t/piece|{{{9|---}}}}}{{t/piece|{{{10|---}}}}}{{t/piece|{{{11|---}}}}}{{t/piece|{{{12|---}}}}}{{t/piece|{{{13|---}}}}}{{t/piece|{{{14|---}}}}}{{t/piece|{{{15|---}}}}}{{t/piece|{{{16|---}}}}}{{t/piece|{{{17|---}}}}}{{t/piece|{{{18|---}}}}}{{t/piece|{{{19|---}}}}}{{t/piece|{{{20|---}}}}}{{t/piece|{{{21|---}}}}}<nowiki>}}</nowiki></includeonly><noinclude>
{{documentation}}</noinclude>
9bbfbb3d891ffa62ccebed3d5790ccf39d59c793
模块:Yesno
828
590
1762
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- 如果你的维基使用非ASCII字符来表示 "是"、"否 "等等
-- 你应该在下面一行用 "mw.ustring.lower(val) "替换 "val:lower()"。
val = type(val) == 'string' and mw.ustring.lower(val) or val
if val == nil then
return nil
elseif val == true
or val == '是'
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or tonumber(val) == 1
then
return true
elseif val == false
or val == '否'
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or tonumber(val) == 0
then
return false
else
return default
end
end
5b7ff8a4cbe46296d30b09c721f894a993825a7f
模块:DependencyList
828
591
1763
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
-- <nowiki>
local p = {}
local libraryUtil = require( 'libraryUtil' )
local enum = require( 'Module:Enum' )
local yn = require( 'Module:Yesno' )
local param = require( 'Module:Paramtest' )
local dpl = require( 'Module:DPLlua' )
local moduleIsUsed = false
local COLLAPSE_LIST_LENGTH_THRESHOLD = 5
local MAX_DYNAMIC_REQUIRE_LIST_LENGTH = 30
local dynamicRequireListQueryCache = {}
--- Used in case 'require( varName )' is found. Attempts to find a string value stored in 'varName'.
---@param content string The content of the module to search in
---@param varName string
---@return string
local function substVarValue( content, varName )
local res = content:match( varName .. '%s*=%s*(%b""%s-%.*)' ) or content:match( varName .. "%s*=%s*(%b''%s-%.*)" ) or ''
if res:find( '^(["\'])[Mm]odule:[%S]+%1' ) and not res:find( '%.%.' ) and not res:find( '%%%a' ) then
return mw.text.trim( res )
else
return ''
end
end
---@param capture string
---@param content string The content of the module to search in
---@return string
local function extractModuleName( capture, content )
capture = capture:gsub( '^%(%s*(.-)%s*%)$', '%1' )
if capture:find( '^(["\']).-%1$' ) then -- Check if it is already a pure string
return capture
elseif capture:find( '^[%a_][%w_]*$' ) then -- Check if if is a single variable
return substVarValue( content, capture )
end
return capture
end
---@param str string
---@return string
local function formatModuleName( str )
return (str:gsub( '^([\'\"])(.-)%1$', function(_, x) return x end ) -- Only remove quotes at start and end of string if both are the same type
:gsub( '_', ' ' )
:gsub( '^.', string.upper )
:gsub( ':(.)', function(x) return ':'..x:upper() end ))
end
--- Used in case a construct like 'require( "Module:wowee/" .. isTheBest )' is found.
--- Will return a list of pages which satisfy this pattern where 'isTheBest' can take any value.
---@param query string
---@return string[] Sequence of strings
local function getDynamicRequireList( query )
if query:find( '%.%.' ) then
query = mw.text.split( query, '..', true )
query = enum.map( query, function(x) return mw.text.trim(x) end )
query = enum.map( query, function(x) return (x:match('^[\'\"](.-)[\'\"]$') or '%') end )
query = table.concat( query )
else
_, query = query:match( '(["\'])(.-)%1' )
query = query:gsub( '%%%a', '%%' )
end
query = query:gsub( '^[Mm]odule:', '' )
if query:find( '^[Ee]xchange/' ) or query:find( '^[Dd]ata/' ) then
return { 'Module:' .. query } -- This format will later be used by formatDynamicQueryLink()
end
if dynamicRequireListQueryCache[ query ] then
return dynamicRequireListQueryCache[ query ]
end
local list = dpl.ask{
namespace = 'Module',
titlematch = query,
nottitlematch = '%/doc|'..query..'/%',
distinct = 'strict',
ignorecase = true,
ordermethod = 'title',
count = MAX_DYNAMIC_REQUIRE_LIST_LENGTH + 1,
skipthispage = 'no',
allowcachedresults = true,
cacheperiod = 604800 -- One week
}
if #list > MAX_DYNAMIC_REQUIRE_LIST_LENGTH then
list = { 'Module:' .. query }
end
dynamicRequireListQueryCache[ query ] = list
return list
end
--- Returns a list of modules loaded and required by module 'moduleName'.
---@param moduleName string
---@param searchForUsedTemplates boolean
---@return string[], string[], string[]
local function getRequireList( moduleName, searchForUsedTemplates )
local content = mw.title.new( moduleName ):getContent()
local requireList = {}
local loadDataList = {}
local usedTemplateList = {}
local dynamicRequirelist = {}
local dynamicLoadDataList = {}
assert( param.has_content( content ), string.format( '%s does not exist', moduleName ) )
content = content:gsub( '%-%-%[(=-)%[.-%]%1%]', '' ):gsub( '%-%-[^\n]*', '' ) -- Strip comments
local function dualGmatch( str, pat1, pat2 )
local f1 = string.gmatch( str, pat1 )
local f2 = string.gmatch( str, pat2 )
return function()
return f1() or f2()
end
end
for match in dualGmatch( content, 'require%s*(%b())', 'require%s*((["\'])%s*[Mm]odule:.-%2)' ) do
match = mw.text.trim( match )
match = extractModuleName( match, content )
if match:find( '%.%.' ) or match:find( '%%%a' ) then
for _, x in ipairs( getDynamicRequireList( match ) ) do
table.insert( dynamicRequirelist, x )
end
elseif match ~= '' then
match = formatModuleName( match )
if match == 'LibraryUtil' then
match = 'Module:LibraryUtil'
end
table.insert( requireList, match )
end
end
for match in dualGmatch( content, 'mw%.loadData%s*(%b())', 'mw%.loadData%s*((["\'])%s*[Mm]odule:.-%2)' ) do
match = mw.text.trim( match )
match = extractModuleName( match, content )
if match:find( '%.%.' ) or match:find( '%%%a' ) then
for _, x in ipairs( getDynamicRequireList( match ) ) do
table.insert( dynamicLoadDataList, x )
end
elseif match ~= '' then
match = formatModuleName( match )
table.insert( loadDataList, match )
end
end
for func, match in string.gmatch( content, 'pcall%s*%(([^,]+),([^%),]+)' ) do
func = mw.text.trim( func )
match = mw.text.trim( match )
if func == 'require' then
for _, x in ipairs( getDynamicRequireList( match ) ) do
table.insert( dynamicRequirelist, x )
end
elseif func == 'mw.loadData' then
for _, x in ipairs( getDynamicRequireList( match ) ) do
table.insert( dynamicLoadDataList, x )
end
end
end
if searchForUsedTemplates then
for preprocess in string.gmatch( content, ':preprocess%s*(%b())' ) do
local function recursiveGMatch( str, pat )
local list = {}
local i = 0
repeat
for match in string.gmatch( list[i] or str, pat ) do
table.insert( list, match )
end
i = i + 1
until i > #list or i > 100
i = 0
return function()
i = i + 1
return list[i]
end
end
for template in recursiveGMatch( preprocess, '{(%b{})}' ) do
local name = string.match( template, '{(.-)[|{}]' )
if name ~= '' then
if name:find( ':' ) then
local ns = name:match( '^(.-):' )
if enum.contains( {'', 'template', 'user'}, ns:lower() ) then
table.insert( usedTemplateList, name )
elseif ns == ns:upper() then
table.insert( usedTemplateList, ns ) -- Probably a magic word
end
else
if name:match( '^%u+$' ) or name == '!' then
table.insert( usedTemplateList, name ) -- Probably a magic word
else
table.insert( usedTemplateList, 'Template:'..name )
end
end
end
end
end
end
dynamicRequirelist = enum.reject( dynamicRequirelist, function(x) return (enum.contains(requireList, x) or enum.contains(loadDataList, x)) end )
dynamicLoadDataList = enum.reject( dynamicLoadDataList, function(x) return (enum.contains(requireList, x) or enum.contains(loadDataList, x)) end )
requireList = enum.insert( requireList, dynamicRequirelist )
requireList = enum.unique( requireList )
loadDataList = enum.insert( loadDataList, dynamicLoadDataList )
loadDataList = enum.unique( loadDataList )
usedTemplateList = enum.unique( usedTemplateList )
table.sort( requireList )
table.sort( loadDataList )
table.sort( usedTemplateList )
return requireList, loadDataList, usedTemplateList
end
--- Returns a list with module and function names used in all '{{#Invoke:moduleName|funcName}}' found on page 'templateName'.
---@param templateName string
---@return table<string, string>[]
local function getInvokeCallList( templateName )
local content = mw.title.new( templateName ):getContent()
local invokeList = {}
assert( param.has_content( content ), string.format( '%s does not exist', templateName ) )
for moduleName, funcName in string.gmatch( content, '{{[{|safeubt:}]-#[Ii]nvoke:([^|]+)|([^}|]+)[^}]*}}' ) do
moduleName = string.format( 'Module:%s', mw.text.trim( moduleName ) )
moduleName = formatModuleName( moduleName )
funcName = mw.text.trim( funcName )
table.insert( invokeList, {moduleName=moduleName, funcName=funcName} )
end
invokeList = enum.unique( invokeList, function(x) return x.moduleName..x.funcName end )
table.sort( invokeList, function(x, y) return x.moduleName..x.funcName < y.moduleName..y.funcName end )
return invokeList
end
--- Returns a list with TemplateStyles found on page 'templateName'.
---@param templateName string
---@return table<string>[]
local function getTemplateStylesList( templateName )
local content = mw.title.new( templateName ):getContent()
local styleList = {}
assert( param.has_content( content ), string.format( '%s does not exist', templateName ) )
for styleName in string.gmatch( content, '<templatestyles src="(.[^"]+)"' ) do
if string.find( styleName, ':', 1, true ) then
styleName = mw.text.trim( styleName )
else
styleName = string.format( 'Template:%s', mw.text.trim( styleName ) )
end
styleName = formatModuleName( styleName )
table.insert( styleList, {styleName=styleName} )
end
styleList = enum.unique( styleList, function(x) return x.styleName end )
table.sort( styleList, function(x, y) return x.styleName < y.styleName end )
return styleList
end
---@param pageName string
---@param addCategories boolean
---@return string
local function messageBoxUnused( pageName, addCategories )
local html = mw.html.create( 'div' ):addClass( 'mbox mbox-med mbox-unusedmodule' ):attr( 'role', 'presentation')
html:tag( 'span' )
:addClass( 'mbox-title' )
:tag( 'span' )
:addClass( 'mbox-icon metadata' )
:wikitext( '[[File:WikimediaUI-Alert.svg|14px|link=]]' )
:done()
:wikitext( 'This module is unused.' )
:done()
:tag( 'span' )
:addClass( 'mbox-text' )
:wikitext(
string.format( 'This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add <code>{{[[Template:Documentation|Documentation]]}}</code>/<code>{{[[Template:No documentation|No documentation]]}}</code> to the calling template\'s or parent\'s module documentation.',
pageName
)
)
:wikitext( addCategories and '[[Category:Unused modules]]' or '' )
:done()
:done()
return tostring( html )
end
local function collapseList( list, id, listType )
local text = string.format( '%d %s', #list, listType )
local button = '<span>' .. text .. ':</span>'
list = enum.map( list, function(x) return '\n# '..x end )
local content = '\n'..table.concat( list )..'\n\n'
return { tostring( button ) .. tostring( content ) }
end
--- Creates a link to [[Special:Search]] showing all pages found by getDynamicRequireList() in case it found more than MAX_DYNAMIC_REQUIRE_LIST_LENGTH pages.
---@param query string @This will be in a format like 'Module:Wowee/%' or 'Module:Wowee/%/data'
---@return string
local function formatDynamicQueryLink( query )
local prefix = query:match( '^([^/]+)' )
local linkText = query:gsub( '%%', '< ... >' )
query = query:gsub( '^Module:', '' )
query = query:gsub( '([^/]+)/?', function ( match )
if match == '%' then
return '\\/[^\\/]+'
else
return '\\/"' .. match .. '"'
end
end )
query = query:gsub( '^\\/', '' )
query = string.format(
'intitle:/%s%s/i -intitle:/%s\\/""/i -intitle:doc prefix:"%s"',
query,
query:find( '"$' ) and '' or '""',
query,
prefix
)
return string.format( '<span class="plainlinks">[%s %s]</span>', tostring( mw.uri.fullUrl( 'Special:Search', { search = query } ) ), linkText )
end
---@param templateName string
---@param addCategories boolean
---@param invokeList table<string, string>[] @This is the list returned by getInvokeCallList()
---@return string
local function formatInvokeCallList( templateName, addCategories, invokeList )
local category = addCategories and '[[Category:Lua-based templates]]' or ''
local res = {}
for _, item in ipairs( invokeList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' invokes function '''%s''' in [[%s]] using [[Star Citizen:Lua|Lua]].</div></div>",
templateName,
item.funcName,
item.moduleName
) )
end
if #invokeList > 0 then
table.insert( res, category )
end
return table.concat( res )
end
---@param moduleName string
---@param addCategories boolean
---@param whatLinksHere string @A list generated by a dpl of pages in the Template namespace which link to moduleName.
---@return string
local function formatInvokedByList( moduleName, addCategories, whatLinksHere )
local templateData = enum.map( whatLinksHere, function(x) return {templateName=x, invokeList=getInvokeCallList(x)} end )
templateData = enum.filter( templateData, function(x)
return enum.any( x.invokeList, function(y)
return y.moduleName:lower() == moduleName:lower()
end )
end )
local invokedByList = {}
for _, template in ipairs( templateData ) do
for _, invoke in ipairs( template.invokeList ) do
table.insert( invokedByList, string.format( "function '''%s''' is invoked by [[%s]]", invoke.funcName, template.templateName ) )
end
end
table.sort( invokedByList)
local res = {}
if #invokedByList > COLLAPSE_LIST_LENGTH_THRESHOLD then
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' is invoked by %s.</div></div>",
moduleName,
collapseList( invokedByList, 'invokedBy', 'templates' )[1]
) )
else
for _, item in ipairs( invokedByList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' is invoked by %s.</div></div>",
moduleName,
item
) )
end
end
if #templateData > 0 then
moduleIsUsed = true
table.insert( res, (addCategories and '[[Category:Template invoked modules]]' or '') )
end
return table.concat( res )
end
---@param moduleName string
---@param addCategories boolean
---@param whatLinksHere string @A list generated by a dpl of pages in the Module namespace which link to moduleName.
---@return string
local function formatRequiredByList( moduleName, addCategories, whatLinksHere )
local childModuleData = enum.map( whatLinksHere, function ( title )
local requireList, loadDataList = getRequireList( title )
return {name=title, requireList=requireList, loadDataList=loadDataList}
end )
local requiredByList = enum.map( childModuleData, function ( item )
if enum.any( item.requireList, function(x) return x:lower()==moduleName:lower() end ) then
if item.name:find( '%%' ) then
return formatDynamicQueryLink( item.name )
else
return '[[' .. item.name .. ']]'
end
end
end )
local loadedByList = enum.map( childModuleData, function ( item )
if enum.any( item.loadDataList, function(x) return x:lower()==moduleName:lower() end ) then
if item.name:find( '%%' ) then
return formatDynamicQueryLink( item.name )
else
return '[[' .. item.name .. ']]'
end
end
end )
if #requiredByList > 0 or #loadedByList > 0 then
moduleIsUsed = true
end
if #requiredByList > COLLAPSE_LIST_LENGTH_THRESHOLD then
requiredByList = collapseList( requiredByList, 'requiredBy', 'modules' )
end
if #loadedByList > COLLAPSE_LIST_LENGTH_THRESHOLD then
loadedByList = collapseList( loadedByList, 'loadedBy', 'modules' )
end
local res = {}
for _, requiredByModuleName in ipairs( requiredByList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' is required by %s.</div></div>",
moduleName,
requiredByModuleName
) )
end
if #requiredByList > 0 then
table.insert( res, (addCategories and '[[Category:Modules required by modules]]' or '') )
end
for _, loadedByModuleName in ipairs( loadedByList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' is loaded by %s.</div></div>",
moduleName,
loadedByModuleName
) )
end
if #loadedByList > 0 then
table.insert( res, (addCategories and '[[Category:Module data]]' or '') )
end
return table.concat( res )
end
local function formatRequireList( currentPageName, addCategories, requireList )
local res = {}
if #requireList > COLLAPSE_LIST_LENGTH_THRESHOLD then
requireList = collapseList( requireList, 'require', 'modules' )
end
for _, requiredModuleName in ipairs( requireList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' requires %s.</div></div>",
currentPageName,
requiredModuleName
) )
end
if #requireList > 0 then
table.insert( res, (addCategories and '[[Category:Modules requiring modules]]' or '') )
end
return table.concat( res )
end
local function formatLoadDataList( currentPageName, addCategories, loadDataList )
local res = {}
if #loadDataList > COLLAPSE_LIST_LENGTH_THRESHOLD then
loadDataList = collapseList( loadDataList, 'loadData', 'modules' )
end
for _, loadedModuleName in ipairs( loadDataList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' loads data from %s.</div></div>",
currentPageName,
loadedModuleName
) )
end
if #loadDataList > 0 then
table.insert( res, (addCategories and '[[Category:Modules using data]]' or '') )
end
return table.concat( res )
end
local function formatUsedTemplatesList( currentPageName, addCategories, usedTemplateList )
local res = {}
if #usedTemplateList > COLLAPSE_LIST_LENGTH_THRESHOLD then
usedTemplateList = collapseList( usedTemplateList, 'usedTemplates', 'templates' )
end
for _, templateName in ipairs( usedTemplateList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' transcludes [[%s]] using <samp>frame:preprocess()</samp>.</div></div>",
currentPageName,
templateName
) )
end
return table.concat( res )
end
---@param templateName string
---@param addCategories boolean
---@param styleList table<string>[] @This is the list returned by getTemplateStylesList()
---@return string
local function formatTemplateStylesList( templateName, addCategories, styleList )
local category = addCategories and '[[Category:Templates using TemplateStyles]]' or ''
local res = {}
for _, item in ipairs( styleList ) do
table.insert( res, string.format(
"<div role='note' class='hatnote'><div class=hatnote-container navigation-not-searchable'><span class='hatnote-icon metadata'>[[File:WikimediaUI-Code.svg|14px|link=]]</span>'''%s''' invokes [[%s]] using [[Star Citizen:TemplateStyles|TemplateStyles]].</div></div>",
templateName,
item.styleName
) )
end
if #styleList > 0 then
table.insert( res, category )
end
return table.concat( res )
end
function p.main( frame )
local args = frame:getParent().args
return p._main( args[1], args.category, args.isUsed )
end
---@param currentPageName string|nil
---@param addCategories boolean|string|nil
---@return string
function p._main( currentPageName, addCategories, isUsed )
libraryUtil.checkType( 'Module:RequireList._main', 1, currentPageName, 'string', true )
libraryUtil.checkTypeMulti( 'Module:RequireList._main', 2, addCategories, {'boolean', 'string', 'nil'} )
libraryUtil.checkTypeMulti( 'Module:RequireList._main', 3, isUsed, {'boolean', 'string', 'nil'} )
local title = mw.title.getCurrentTitle()
-- Leave early if not in module, template namespace or if module is part of exchange or data groups
if param.is_empty( currentPageName ) and (
( not enum.contains( {'Module', 'Template'}, title.nsText ) ) or
( title.nsText == 'Module' and ( enum.contains( {'Exchange', 'Exchange historical', 'Data'}, title.text:match( '^(.-)/' ) ) ) )
) then
return ''
end
currentPageName = param.default_to( currentPageName, title.fullText )
currentPageName = string.gsub( currentPageName, '/[Dd]oc$', '' )
currentPageName = formatModuleName( currentPageName )
addCategories = yn( param.default_to( addCategories, title.subpageText~='doc' ) )
moduleIsUsed = yn( param.default_to( isUsed, false ) )
if title.text:match( '^(.-)/' ) == 'Sandbox' then
moduleIsUsed = true -- Don't show sandbox modules as unused
end
if currentPageName:find( '^Template:' ) then
local invokeList = getInvokeCallList( currentPageName )
local styleList = getTemplateStylesList( currentPageName )
return formatInvokeCallList( currentPageName, addCategories, invokeList ) .. formatTemplateStylesList( currentPageName, addCategories, styleList )
end
local whatTemplatesLinkHere, whatModulesLinkHere = dpl.ask( {
namespace = 'Template',
linksto = currentPageName,
distinct = 'strict',
ignorecase = true,
ordermethod = 'title',
allowcachedresults = true,
cacheperiod = 604800 -- One week
}, {
namespace = 'Module',
linksto = currentPageName,
nottitlematch = '%/doc|Exchange/%|Data/%|' .. currentPageName:gsub( 'Module:', '' ),
distinct = 'strict',
ignorecase = true,
ordermethod = 'title',
allowcachedresults = true,
cacheperiod = 604800 -- One week
} )
local requireList, loadDataList, usedTemplateList = getRequireList( currentPageName, true )
requireList = enum.map( requireList, function ( moduleName )
if moduleName:find( '%%' ) then
return formatDynamicQueryLink( moduleName )
else
return '[[' .. moduleName .. ']]'
end
end )
loadDataList = enum.map( loadDataList, function ( moduleName )
if moduleName:find( '%%' ) then
return formatDynamicQueryLink( moduleName )
else
return '[[' .. moduleName .. ']]'
end
end )
usedTemplateList = enum.map( usedTemplateList, function( templateName )
if string.find( templateName, ':' ) then -- Real templates are prefixed by a namespace, magic words are not
return '[['..templateName..']]'
else
return "'''{{"..templateName.."}}'''" -- Magic words don't have a page so make them bold instead
end
end )
local res = {}
table.insert( res, formatInvokedByList( currentPageName, addCategories, whatTemplatesLinkHere ) )
table.insert( res, formatRequireList( currentPageName, addCategories, requireList ) )
table.insert( res, formatLoadDataList( currentPageName, addCategories, loadDataList ) )
table.insert( res, formatUsedTemplatesList( currentPageName, addCategories, usedTemplateList ) )
table.insert( res, formatRequiredByList( currentPageName, addCategories, whatModulesLinkHere ) )
if not moduleIsUsed then
table.insert( res, 1, messageBoxUnused( currentPageName:gsub( 'Module:', '' ), addCategories ) )
end
return table.concat( res )
end
return p
-- </nowiki>
ba3a98219af09c6579bb9dfacdb07ba3693cd10a
模块:Paramtest
828
593
1765
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
--[[
{{Helper module
|name=Paramtest
|fname1 = is_empty(arg)
|ftype1 = String
|fuse1 = Returns true if arg is not defined or contains only whitespace
|fname2 = has_content(arg)
|ftype2 = String
|fuse2 = Returns true if arg exists and does not only contain whitespace
|fname3 = default_to(arg1,arg2)
|ftype3 = String, Any value
|fuse3 = If arg1 exists and does not only contain whitespace, the function returns arg1, otherwise returns arg2
|fname4 = defaults{ {arg1,arg2},...}
|ftype4 = {String, Any value}...
|fuse4 = Does the same as <code>default_to()</code> run over every table passed; for technical reasons, all <code>nil</code> are replaced with <code>false</code>
}}
--]]
--
-- Tests basic properties of parameters
--
local p = {}
--
-- Tests if the parameter is empty, all white space, or undefined
--
function p.is_empty(arg)
return not string.find(arg or '', '%S')
end
--
-- Returns the parameter if it has any content, the default (2nd param)
--
function p.default_to(arg, default)
if string.find(arg or '', '%S') then
return arg
else
return default
end
end
--
-- Returns a list of paramaters if it has any content, or the default
--
function p.defaults(...)
local ret = {}
for i, v in ipairs(...) do
if string.find(v[1] or '', '%S') then
table.insert(ret,v[1])
else
-- or false, because nil is removed
table.insert(ret,v[2] or false)
end
end
return unpack(ret)
end
--
-- Tests if the parameter has content
-- The same as !is_empty, but this is more readily clear
--
function p.has_content(arg)
return string.find(arg or '', '%S')
end
--
-- uppercases first letter
--
function p.ucfirst(arg)
if not arg or arg:len() == 0 then
return nil
elseif arg:len() == 1 then
return arg:upper()
else
return arg:sub(1,1):upper() .. arg:sub(2)
end
end
--
-- uppercases first letter, lowercases everything else
--
function p.ucflc(arg)
if not arg or arg:len() == 0 then
return nil
elseif arg:len() == 1 then
return arg:upper()
else
return arg:sub(1,1):upper() .. arg:sub(2):lower()
end
end
return p
cfa20dcb7af37a9dea2d5bb367b11815f5ec675f
模块:DPLlua
828
594
1766
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
-- <nowiki>
local dpl = {}
local libraryUtil = require( 'libraryUtil' )
local hasContent = require( 'Module:Paramtest' ).has_content
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
dpl.pipe = '¦'
local dataContentMarker = '`#@@#`'
local allIncludedParamNames = {}
-- Custom function for splitting a string because mw.text.split() is waaay too slow
local function split( str, pattern, plain )
local res = {}
local continue = true
local startIndex = 1
while continue do
local i, j = string.find( str, pattern, startIndex, plain )
if i then
table.insert( res, string.sub( str, startIndex, i-1 ) )
startIndex = j + 1
else
table.insert( res, string.sub( str, startIndex ) )
continue = false
end
end
return res
end
-- Also custom function for speed
local function trim( str )
return (string.gsub( str, '^%s+', '' ):gsub( '%s+$', '' ))
end
local function mergeItem( tbl, key, item )
if type( tbl[key] ) == 'table' and type( item ) == 'table' then
for k in pairs( tbl[key] ) do
mergeItem( tbl[key], k, item[k] )
end
elseif type( tbl[key] ) == 'table' then
table.insert( tbl[key], item )
else
tbl[key] = { tbl[key], item }
end
end
local escapeChars = {
['{'] = '{',
['}'] = '}',
['['] = '[',
[']'] = ']',
['|'] = '|',
['-'] = '‐'
}
local function escape( str )
return (string.gsub( str, '[{}%[%]|%-]', escapeChars ))
end
local unEscapeChars = {
['{'] = '{',
['}'] = '}',
['['] = '[',
[']'] = ']',
['|'] = '|',
['‐'] = '-'
}
local function unEscape( str )
return (string.gsub( str, '&#%d+;', unEscapeChars ))
end
local function fixCurlyBrackets( str )
-- the \226\157\180\181 are used to match ❴ (U+2774) and ❵ (U+2775) wich are 3 bytes long (UTF-8) so
-- we can't use them directly inside [] patterns. Ustring would fix this but it's way too slow.
return (string.gsub( str, '\226\157[\180\181]', { ['❴'] = '{', ['❵'] = '}' } ))
end
local function removeFormattingSettings( query )
local toRemove = {
'mode',
'table',
'tablerow',
'tablesortcol',
'headingmode',
'headingcount',
'listattr',
'itemattr',
'hlistattr',
'hitemattr',
'userdateformat',
'shownamespace',
'escapelinks',
'titlemaxlength',
'replaceintitle',
'columns',
'rows',
'rowsize',
'rowcolformat',
'resultsheader',
'resultsfooter',
'oneresultheader',
'oneresultfooter',
'noresultsheader',
'suppresserrors',
'noresultsfooter',
'format',
'groupMultiTemplateResults'
}
for _, k in ipairs( toRemove ) do
query[k] = nil
end
end
local function formatInclude( query )
checkTypeForNamedArg( 'Module:DPLlua.ask', 'include', query, 'string' )
query = split( query, ',', true )
local includedParamNames = {}
local sectionAttributes = {}
for i = 1, #query do
if query[i]:match( '%b{}' ) then -- Check if we are including a template
local templateName, extra = query[i]:match( '{(.-)[¦|}](.*)' )
if hasContent( extra ) then
local phantomTemplateName = extra:match( '^(.-)}' ) or extra:match( '^[./].+' )
local phantomTemplatePrefix = extra:match( '^(.-)}' ) and '' or templateName
local params = extra:gsub( '^.-}', '' ):gsub( '^[./].+', '' ):gsub( ':%-', '' )
local sur = hasContent( phantomTemplateName ) and ('¦' .. phantomTemplatePrefix .. phantomTemplateName) or ''
query[i] = string.format( '{%s%s}%s', templateName, sur, params )
if hasContent( phantomTemplateName ) then
table.insert( includedParamNames, { name=phantomTemplatePrefix..phantomTemplateName, isTemplate=true, hasPhantomTemplate=true } )
table.insert( sectionAttributes, { hasPhantomTemplate=true } )
else
for param in params:gmatch( ':([^:]*)' ) do
param = trim( param )
table.insert( includedParamNames, { name=templateName, isTemplate=true, param=param } )
end
table.insert( sectionAttributes, { hasPhantomTemplate=false } )
end
else
query[i] = string.format( '{%s¦DPLlua helper}', templateName ) -- Use a helper template to get all the parameters of our included template
table.insert( includedParamNames, { name=templateName, isTemplate=true, includeAll=true } )
table.insert( sectionAttributes, { hasPhantomTemplate=false } )
end
else
table.insert( includedParamNames, { name=trim( query[i] ) } )
table.insert( sectionAttributes, { hasPhantomTemplate=false } )
end
end
return table.concat( query, ',' ), includedParamNames, sectionAttributes
end
local function formatDpl( query )
local queries = {}
local count = query.count or 500
local offset = query.offset or 0
local usesInclude = false
local includedParamNames = {}
local sectionAttributes
query.count = nil
query.offset = nil
-- Use table format so we can place dataContentMarkers around each included parameter. The secseparator
-- is needed to add dataContentMarkers when a phantom template is used
local dplStringInclude =
[=[
{{#dpl:
|noresultsheader=@@
|count=%s
|offset=%s
|%s
|table=,
|listseparators=,\n¦-\n¦[[%%PAGE%%¦]],,
|tablerow=%s
|secseparators=%s
}}]=]
-- Table format requires an include statement so we use format instead.
-- This is also a lot faster than adding an empty include statement
local dplStringNoInclude =
[=[
{{#dpl:
|noresultsheader=@@
|count=%s
|offset=%s
|%s
|format=,¦-¦[[%%PAGE%%¦]],,
}}]=]
-- Auto generate more than one dpl if count > 500
-- The results of these are later combined
for i = 1, math.ceil( count / 500 ) do
local params = {}
for k, v in pairs( query ) do
if k == 'include' then
v, includedParamNames, sectionAttributes = formatInclude( v )
usesInclude = true
end
if type( v ) == 'table' then
for _, x in ipairs( v ) do
table.insert( params, k .. '=' .. tostring( x ):gsub( '|', '¦' ) )
end
else
table.insert( params, k .. '=' .. tostring( v ):gsub( '|', '¦' ) )
end
end
if usesInclude then
local secseparators = ''
for _, v in ipairs( sectionAttributes ) do
if v.hasPhantomTemplate then
-- Phantom templates need this because they ignore tablerow formatting
secseparators = secseparators .. '¶¦' .. dataContentMarker .. ',' .. dataContentMarker .. ','
else
secseparators = secseparators .. '¶¦,,'
end
end
table.insert( queries, string.format(
dplStringInclude,
count > 500 and 500 or count,
offset,
table.concat( params, '\n|' ),
string.rep( dataContentMarker..'%%'..dataContentMarker..',', #includedParamNames ),
secseparators
) )
else
table.insert( queries, string.format(
dplStringNoInclude,
count > 500 and 500 or count,
offset,
table.concat( params, '\n|' )
) )
end
count = count - 500
offset = offset + 500
end
table.insert( allIncludedParamNames, includedParamNames )
return table.concat( queries )
end
local function toTable( query, groupMultiTemplateResults )
local includedParamNames = table.remove( allIncludedParamNames, 1 )
local usesInclude = #includedParamNames > 0
local res = {}
query = query:gsub( '<p>Extension:DynamicPageList .-</p>', function(item) res.error = item; return '' end )
if query:find( '^@@' ) then -- @@ is used when no result is found
return res
end
if usesInclude then
query = query:gsub( dataContentMarker..'(.-)'..dataContentMarker, escape )
end
query = trim( query )
query = split( query, '|-', true ) -- Results of the returned pages are separated by |-
for _, v in ipairs( query ) do
if hasContent( v ) and not v:find( '^@@' ) then
v = trim( v )
local title = v:match( '^|%[%[(.-)|' )
local rawDataList = v:match( '^|.-|.-|(.*)' ) -- This is everything after the title
if not usesInclude then
if title and title ~= '' then
table.insert( res, title )
end
else
-- When multiple includes are used (e.g. include={Template1},{Template2} or include={Template}:1:2) their results are separated by a pipe
rawDataList = split( rawDataList, '|', true )
local cleanedDataList = {}
for _incIndex, dataItem in ipairs( rawDataList ) do
local incIndex = ((_incIndex - 1) % #includedParamNames) + 1 -- Needed in case the same template appears multiple times on the same page
dataItem = unEscape( dataItem )
dataItem = trim( dataItem )
if includedParamNames[ incIndex ].isTemplate and includedParamNames[ incIndex ].includeAll then -- Check if we included a full template
-- When we include an entire template we use the %ARGS% parameter supplied by dpl.
-- However all | characters are repaced with §, e.g.:
-- §namelessParam
-- §param = text [[wowee§link text]]
-- §param2 = text {{something§something else}}
dataItem = dataItem:gsub( '\127\'"`UNIQ%-%-nowiki%-%x+%-QINU`"\'\127', function(item) return '<nowiki>' .. item .. '</nowiki>' end )
dataItem = mw.text.unstripNoWiki( dataItem ) -- Unstrip nowiki so we can clean their content
dataItem = fixCurlyBrackets( dataItem ) -- When using the %ARGS% dpl parameter, curly brackets are replaced with ❴ (U+2774) and ❵ (U+2775)
dataItem = dataItem:gsub( '%b{}', function(x) return x:gsub( '§', '|' ) end ) -- Restore pipe characters inside links and templates
dataItem = dataItem:gsub( '%b[]', function(x) return x:gsub( '§', '|' ) end )
dataItem = dataItem:gsub( '<nowiki>(.-)</nowiki>', function(x) return mw.getCurrentFrame():extensionTag( 'nowiki', x ) end ) -- Restrip nowiki
local _dataItem = {}
if dataItem ~= '' then
dataItem = split( dataItem:sub( 3 ), '§' ) -- The sub(3) removes the first § at the start. § is 2 bytes wide so start at index 3
for i, item in ipairs( dataItem ) do
if item:find( '=' ) then -- Check if the parameter is named or unnamed
local param, value = item:match( '^%s*(.-)%s*=%s*(.-)%s*$' )
_dataItem[ param ] = value
else
table.insert( _dataItem, trim( item ) )
end
end
end
dataItem = _dataItem
end
local dataListIndex = groupMultiTemplateResults and 1 or math.ceil( _incIndex / #includedParamNames )
if
includedParamNames[ incIndex ].isTemplate and
not includedParamNames[ incIndex ].includeAll and
not includedParamNames[ incIndex ].hasPhantomTemplate
then -- This means there was an include in the form 'include = {template}:param'
local templateName = includedParamNames[ incIndex ].name
local paramName = includedParamNames[ incIndex ].param
paramName = tonumber( paramName ) or paramName -- Keep as string if tonumber fails
cleanedDataList[ dataListIndex ] = cleanedDataList[ dataListIndex ] or {}
cleanedDataList[ dataListIndex ][ templateName ] = cleanedDataList[ dataListIndex ][ templateName ] or {}
if groupMultiTemplateResults and _incIndex > #includedParamNames then
mergeItem( cleanedDataList[ dataListIndex ][ templateName ], paramName, dataItem )
else
cleanedDataList[ dataListIndex ][ templateName ][ paramName ] = dataItem
end
else
local templateName = includedParamNames[ incIndex ].name
cleanedDataList[ dataListIndex ] = cleanedDataList[ dataListIndex ] or {}
if groupMultiTemplateResults and _incIndex > #includedParamNames then
mergeItem( cleanedDataList[ dataListIndex ], templateName, dataItem )
else
cleanedDataList[ dataListIndex ][ templateName ] = dataItem
end
end
end
if title and title ~= '' then
for _, v in ipairs( cleanedDataList ) do
table.insert( res, { title=title, include=v } )
end
end
end
end
end
return res
end
-- Accepts a series of tables each containig the settings for a dpl query.
-- Combinig multiple dpl queries yields better performance than doing them sequentially
function dpl.ask( ... )
local formatTime = os.clock()
local queries = { ... }
local wantsGrouping = {}
for i = 1, #queries do
checkType( 'Module:DPLlua.ask', i, queries[i], 'table' )
table.insert( wantsGrouping, queries[i].groupMultiTemplateResults or false )
removeFormattingSettings( queries[i] )
queries[i] = formatDpl( queries[i] )
end
formatTime = os.clock() - formatTime
local DPLtime = os.clock()
queries = table.concat( queries, '$@µ@$' )
queries = mw.getCurrentFrame():preprocess( queries )
queries = split( queries, '$@µ@$', true )
DPLtime = os.clock() - DPLtime
for i = 1, #queries do
local parseTime = os.clock()
queries[i] = toTable( queries[i], wantsGrouping[i] )
parseTime = os.clock() - parseTime
queries[i]['DPL time'] = DPLtime
queries[i]['Parse time'] = math.floor( (formatTime + parseTime) * 1e5 ) / 1e5 -- os.clock() has a resolution of 10µs
end
return unpack( queries )
end
-- function dpl.test()
-- local time = os.clock()
-- local a, b = dpl.ask({
-- namespace = 'Module',
-- linksto = 'Module:Chart data',
-- distinct = 'strict',
-- ordermethod = 'title',
-- nottitlematch = '%/doc¦%sandbox%¦Exchange/%¦Exchange historical/%¦Chart data',
-- ignorecase = 'true',
-- allowcachedresults = false
-- },{
-- namespace = 'Module',
-- linksto = 'Module:Enum',
-- distinct = 'strict',
-- ordermethod = 'title',
-- nottitlematch = '%/doc¦%sandbox%¦Exchange/%¦Exchange historical/%¦Enum',
-- ignorecase = 'true',
-- allowcachedresults = false
-- })
-- mw.logObject(a)
-- mw.logObject(b)
-- local a, b = dpl.ask({
-- namespace = 'Module',
-- linksto = 'Module:Chart data',
-- distinct = 'strict',
-- ordermethod = 'title',
-- nottitlematch = '%/doc¦%sandbox%¦Exchange/%¦Exchange historical/%¦Chart data',
-- ignorecase = 'true',
-- allowcachedresults = false
-- },{
-- namespace = '',
-- ignorecase = 'true',
-- uses = 'Template:Infobox Recipe',
-- count = 50,
-- include = '{Infobox Recipe},{Infobox Item}',
-- allowcachedresults = false
-- })
-- mw.logObject(a)
-- mw.logObject(b)
-- local a = dpl.ask{
-- namespace = '',
-- uses = 'Template:Infobox Recipe',
-- include = '{Infobox Recipe}:skill:name,{Infobox Item}:update,{Infobox Item|test}',
-- count = 50,
-- ordermethod = 'title',
-- }
-- mw.logObject(a)
-- local q = dpl.ask{
-- uses = "Template:Collections table",
-- category = "Archaeology collections",
-- -- include = "{Infobox collection}:reward,{Collections table}:1:2:3:4:5:6:7:8:9:10:11:12:13:14:15",
-- include = "{Infobox collection}:reward,{Collections table}",
-- count = 100
-- }
-- mw.logObject(q)
-- local q = dpl.ask{
-- namespace = "",
-- uses = "Template:Infobox spell",
-- notcategory = {"Removed content", "Removed spells"},
-- nottitlematch = {"Enchant Crossbow Bolt", "Storm of Armadyl"},
-- include = "{Infobox spell}",
-- }
-- mw.logObject(q)
-- local list = dpl.ask{
-- namespace = 'Template',
-- uses = 'Template:Navbox',
-- ordermethod = 'title',
-- include = '{Navbox}:gtitle1:gtitle2',
-- count = 1,
-- offset = 3
-- }
-- mw.logObject(list)
-- local list = dpl.ask{
-- namespace = 'User',
-- titlematch = 'CephHunter/Sandbox/test1',
-- include = '{User:CephHunter/Sandbox/test2|User:CephHunter/Sandbox/test3},{User:CephHunter/Sandbox/test3}:1',
-- }
-- mw.logObject(list)
-- mw.logObject(dpl.ask{
-- namespace = 'User',
-- ignorecase = 'true',
-- titlematch = 'CephHunter/Sandbox/test1',
-- include = '{User:CephHunter/Sandbox/test2}'
-- })
-- mw.logObject(dpl.ask{
-- namespace = 'Module',
-- uses = 'Template:Helper module',
-- titlematch = '%/doc',
-- nottitlematch = 'Exchange/%|Exchange historical/%|Sandbox/%',
-- ordermethod = 'title',
-- include = '{Helper module}, {Helper module}:example',
-- count = 1,
-- offset = 13
-- })
-- mw.logObject(dpl.ask{
-- namespace = 'Module',
-- titlematch = 'Chart data|Absorbative calculator',
-- nottitlematch = 'Exchange/%|Exchange historical/%|Sandbox/%|%/doc|DPLlua%',
-- ordermethod = 'title',
-- include = '%0'
-- })
-- mw.logObject(dpl.ask{
-- uses = 'Template:Collections table',
-- include = '{Collections table}',
-- count = 5
-- })
-- mw.log(os.clock()-time)
-- end
return dpl
-- </nowiki>
a4585a9ed619b57adfaa5cf8d9279da529e74df5
模板:T/piece
10
598
1770
2023-03-12T06:43:42Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{#ifeq: {{{1|---}}}|---|||<font color="gray">''<{{{1}}}>''</font>}}<noinclude>
{{/doc}}</noinclude>
2ddf7df2334b2a1624bf213ade67ba6b68296e86
模块:Arguments
828
603
1775
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
模块:LibraryUtil
828
604
1776
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
-- <nowiki>
local libraryUtil = require( 'libraryUtil' )
-- libraryUtil is a standard scribunto module, the following commented out code is just to show what is inside it. Documentation about these functions can be found at https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#libraryUtil
--[=[
local libraryUtil = {}
function libraryUtil.checkType( name, argIdx, arg, expectType, nilOk )
if arg == nil and nilOk then
return
end
if type( arg ) ~= expectType then
local msg = string.format( "bad argument #%d to '%s' (%s expected, got %s)",
argIdx, name, expectType, type( arg )
)
error( msg, 3 )
end
end
function libraryUtil.checkTypeMulti( name, argIdx, arg, expectTypes )
local argType = type( arg )
for _, expectType in ipairs( expectTypes ) do
if argType == expectType then
return
end
end
local n = #expectTypes
local typeList
if n > 1 then
typeList = table.concat( expectTypes, ', ', 1, n - 1 ) .. ' or ' .. expectTypes[n]
else
typeList = expectTypes[1]
end
local msg = string.format( "bad argument #%d to '%s' (%s expected, got %s)",
argIdx,
name,
typeList,
type( arg )
)
error( msg, 3 )
end
function libraryUtil.checkTypeForIndex( index, value, expectType )
if type( value ) ~= expectType then
local msg = string.format( "value for index '%s' must be %s, %s given",
index, expectType, type( value )
)
error( msg, 3 )
end
end
function libraryUtil.checkTypeForNamedArg( name, argName, arg, expectType, nilOk )
if arg == nil and nilOk then
return
end
if type( arg ) ~= expectType then
local msg = string.format( "bad named argument %s to '%s' (%s expected, got %s)",
argName, name, expectType, type( arg )
)
error( msg, 3 )
end
end
function libraryUtil.makeCheckSelfFunction( libraryName, varName, selfObj, selfObjDesc )
return function ( self, method )
if self ~= selfObj then
error( string.format(
"%s: invalid %s. Did you call %s with a dot instead of a colon, i.e. " ..
"%s.%s() instead of %s:%s()?",
libraryName, selfObjDesc, method, varName, method, varName, method
), 3 )
end
end
end
]=]
function libraryUtil.makeCheckClassFunction( libraryName, varName, class, selfObjDesc )
return function ( self, method )
if getmetatable( self ) ~= class then
error( string.format(
"%s: invalid %s. Did you call %s with a dot instead of a colon, i.e. " ..
"%s.%s() instead of %s:%s()?",
libraryName, selfObjDesc, method, varName, method, varName, method
), 3 )
end
end
end
return libraryUtil
-- </nowiki>
e6bdd6cd1d63b0f32aed2b10cac598f1eaacc478
模块:Hatnote
828
605
1777
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
local function decorateHatnote(hatnote, options)
local function getIcon(filename)
local html = ''
if type(filename) == 'string' then
local icon = mw.html.create('span')
icon
:addClass('hatnote-icon')
:addClass('metadata')
:wikitext('[[File:' .. filename .. '|14px|link=]]')
:done()
html = tostring(icon)
end
return html
end
local container = mw.html.create('div')
container
:addClass('hatnote-container')
:wikitext(getIcon(options.icon))
:wikitext(tostring(hatnote))
:done()
return container
end
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
-- Decorate WP hatnote to SCW standard
hatnote = decorateHatnote(hatnote, options)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
d454a285f0c94ef1ef9715db7485720b58d59167
模块:Hatnote list
828
606
1778
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
local function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
d0828422b1aa0d0d0092d699d059c9e882260398
模块:Array
828
608
1780
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
-- <nowiki> awawa
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
local arr = {}
setmetatable(arr, {
__call = function (_, array)
return arr.new(array)
end
})
function arr.__index(t, k)
if type(k) == 'table' then
local res = arr.new()
for i = 1, #t do
res[i] = t[k[i]]
end
return res
else
return arr[k]
end
end
function arr.__tostring(array)
local dumpObject = require('Module:Logger').dumpObject
setmetatable(array, nil)
local str = dumpObject(array, {clean=true, collapseLimit=100})
setmetatable(array, arr)
return str
end
function arr.__concat(lhs, rhs)
if type(lhs) == 'table' and type(rhs) == 'table' then
local res = setmetatable({}, getmetatable(lhs) or getmetatable(rhs))
for i = 1, #lhs do
res[i] = lhs[i]
end
local l = #lhs
for i = 1, #rhs do
res[i + l] = rhs[i]
end
return res
else
return tostring(lhs) .. tostring(rhs)
end
end
function arr.__unm(array)
return arr.map(array, function(x) return -x end)
end
local function mathTemplate(lhs, rhs, funName, fun)
checkTypeMulti('Module:Array.' .. funName, 1, lhs, {'number', 'table'})
checkTypeMulti('Module:Array.' .. funName, 2, rhs, {'number', 'table'})
local res = setmetatable({}, getmetatable(lhs) or getmetatable(rhs))
if type(lhs) == 'number' then
for i = 1, #rhs do
res[i] = fun(lhs, rhs[i])
end
elseif type(rhs) == 'number' then
for i = 1, #lhs do
res[i] = fun(lhs[i], rhs)
end
else
assert(#lhs == #rhs, string.format('Tables are not equal length (lhs=%d, rhs=%d)', #lhs, #rhs))
for i = 1, #lhs do
res[i] = fun(lhs[i], rhs[i])
end
end
return res
end
function arr.__add(lhs, rhs)
return mathTemplate(lhs, rhs, '__add', function(x, y) return x + y end)
end
function arr.__sub(lhs, rhs)
return mathTemplate(lhs, rhs, '__sub', function(x, y) return x - y end)
end
function arr.__mul(lhs, rhs)
return mathTemplate(lhs, rhs, '__mul', function(x, y) return x * y end)
end
function arr.__div(lhs, rhs)
return mathTemplate(lhs, rhs, '__div', function(x, y) return x / y end)
end
function arr.__pow(lhs, rhs)
return mathTemplate(lhs, rhs, '__pow', function(x, y) return x ^ y end)
end
function arr.__lt(lhs, rhs)
for i = 1, math.min(#lhs, #rhs) do
if lhs[i] >= rhs[i] then
return false
end
end
return true
end
function arr.__le(lhs, rhs)
for i = 1, math.min(#lhs, #rhs) do
if lhs[i] > rhs[i] then
return false
end
end
return true
end
function arr.__eq(lhs, rhs)
if #lhs ~= #rhs then
return false
end
for i = 1, #lhs do
if lhs[i] ~= rhs[i] then
return false
end
end
return true
end
function arr.all(array, fn)
checkType('Module:Array.all', 1, array, 'table')
if fn == nil then fn = function(item) return item end end
if type(fn) ~= 'function' then
local val = fn
fn = function(item) return item == val end
end
local i = 1
while array[i] ~= nil do
if not fn(array[i], i) then
return false
end
i = i + 1
end
return true
end
function arr.any(array, fn)
checkType('Module:Array.any', 1, array, 'table')
if fn == nil then fn = function(item) return item end end
if type(fn) ~= 'function' then
local val = fn
fn = function(item) return item == val end
end
local i = 1
while array[i] ~= nil do
if fn(array[i], i) then
return true
end
i = i + 1
end
return false
end
function arr.clean(array)
checkType('Module:Array.clean', 1, array, 'table')
for i = 1, #array do
if type(array[i]) == 'table' then
arr.clean(array[i])
end
end
setmetatable(array, nil)
return array
end
function arr.contains(array, elem, useElemTableContent)
checkType('Module:Array.contains', 1, array, 'table')
if type(elem) == 'table' and useElemTableContent ~= false then
local elemMap = {}
local isFound = {}
arr.each(elem, function(x, i) elemMap[x] = i; isFound[i] = false end)
for i = 1, #array do
local j = elemMap[array[i]]
if j then
isFound[j] = true
end
end
return arr.all(isFound, true)
else
return arr.any(array, function(item) return item == elem end)
end
end
function arr.count(array, fn)
checkType('Module:Array.count', 1, array, 'table')
if fn == nil then fn = function(item) return item end end
if type(fn) ~= 'function' then
local val = fn
fn = function(item) return item == val end
end
local count = 0
for i = 1, #array do
if fn(array[i]) then
count = count + 1
end
end
return count
end
function arr.diff(array, order)
checkType('Module:Array.diff', 1, array, 'table')
checkType('Module:Array.diff', 2, order, 'number', true)
local res = setmetatable({}, getmetatable(array))
for i = 1, #array - 1 do
res[i] = array[i+1] - array[i]
end
if order and order > 1 then
return arr.diff(res, order - 1)
end
return res
end
function arr.each(array, fn)
checkType('Module:Array.each', 1, array, 'table')
checkType('Module:Array.each', 2, fn, 'function')
local i = 1
while array[i] ~= nil do
fn(array[i], i)
i = i + 1
end
end
function arr.filter(array, fn)
checkType('Module:Array.filter', 1, array, 'table')
if fn == nil then fn = function(item) return item end end
if type(fn) ~= 'function' then
local val = fn
fn = function(item) return item == val end
end
local r = setmetatable({}, getmetatable(array))
local len = 0
local i = 1
while array[i] ~= nil do
if fn(array[i], i) then
len = len + 1
r[len] = array[i]
end
i = i + 1
end
return r
end
function arr.find(array, fn, default)
checkType('Module:Array.find', 1, array, 'table')
checkTypeMulti('Module:Array.find_index', 2, fn, {'function', 'table', 'number', 'boolean'})
if type(fn) ~= 'function' then
local val = fn
fn = function(item) return item == val end
end
local i = 1
while array[i] ~= nil do
if fn(array[i], i) then
return array[i], i
end
i = i + 1
end
return default
end
function arr.find_index(array, fn, default)
checkType('Module:Array.find_index', 1, array, 'table')
checkTypeMulti('Module:Array.find_index', 2, fn, {'function', 'table', 'number', 'boolean'})
if type(fn) ~= 'function' then
local val = fn
fn = function(item) return item == val end
end
local i = 1
while array[i] ~= nil do
if fn(array[i], i) then
return i
end
i = i + 1
end
return default
end
function arr.newIncrementor(start, step)
checkType('Module:Array.newIncrementor', 1, start, 'number', true)
checkType('Module:Array.newIncrementor', 2, step, 'number', true)
step = step or 1
local n = (start or 1) - step
local obj = {}
return setmetatable(obj, {
__call = function() n = n + step return n end,
__tostring = function() return n end,
__index = function() return n end,
__newindex = function(self, k, v)
if k == 'step' and type(v) == 'number' then
step = v
elseif type(v) == 'number' then
n = v
end
end,
__concat = function(x, y) return tostring(x) .. tostring(y) end
})
end
function arr.int(array, start, stop)
checkType('Module:Array.int', 1, array, 'table')
checkType('Module:Array.int', 2, start, 'number', true)
checkType('Module:Array.int', 3, stop, 'number', true)
local res = setmetatable({}, getmetatable(array))
start = start or 1
stop = stop or #array
res[1] = array[start]
for i = 1, stop - start do
res[i+1] = res[i] + array[start + i]
end
return res
end
function arr.intersect(array1, array2)
checkType('Module:Array.intersect', 1, array1, 'table')
checkType('Module:Array.intersect', 2, array2, 'table')
local array2Elements = {}
local res = setmetatable({}, getmetatable(array1) or getmetatable(array2))
local len = 0
arr.each(array2, function(item) array2Elements[item] = true end)
arr.each(array1, function(item)
if array2Elements[item] then
len = len + 1
res[len] = item
end
end)
return res
end
function arr.intersects(array1, array2)
checkType('Module:Array.intersects', 1, array1, 'table')
checkType('Module:Array.intersects', 2, array2, 'table')
local small = {}
local large
if #array1 <= #array2 then
arr.each(array1, function(item) small[item] = true end)
large = array2
else
arr.each(array2, function(item) small[item] = true end)
large = array1
end
return arr.any(large, function(item) return small[item] end)
end
function arr.insert(array, val, index, unpackVal)
checkType('Module:Array.insert', 1, array, 'table')
checkType('Module:Array.insert', 3, index, 'number', true)
checkType('Module:Array.insert', 4, unpackVal, 'boolean', true)
local len = #array
index = index or (len + 1)
if type(val) == 'table' and unpackVal ~= false then
local len2 = #val
for i = 0, len - index do
array[len + len2 - i] = array[len - i]
end
for i = 0, len2 - 1 do
array[index + i] = val[i + 1]
end
else
table.insert(array, index, val)
end
return array
end
function arr.map(array, fn)
checkType('Module:Array.map', 1, array, 'table')
checkType('Module:Array.map', 2, fn, 'function')
local len = 0
local r = setmetatable({}, getmetatable(array))
local i = 1
while array[i] ~= nil do
local tmp = fn(array[i], i)
if tmp ~= nil then
len = len + 1
r[len] = tmp
end
i = i + 1
end
return r
end
function arr.max_by(array, fn)
checkType('Module:Array.max_by', 1, array, 'table')
checkType('Module:Array.max_by', 2, fn, 'function')
return unpack(arr.reduce(array, function(new, old, i)
local y = fn(new)
return y > old[2] and {new, y, i} or old
end, {nil, -math.huge}))
end
function arr.max(array)
checkType('Module:Array.max', 1, array, 'table')
local val, _, i = arr.max_by(array, function(x) return x end)
return val, i
end
function arr.min(array)
checkType('Module:Array.min', 1, array, 'table')
local val, _, i = arr.max_by(array, function(x) return -x end)
return val, i
end
function arr.new(array)
array = array or {}
for _, v in pairs(array) do
if type(v) == 'table' then
arr.new(v)
end
end
if getmetatable(array) == nil then
setmetatable(array, arr)
end
return array
end
function arr.range(start, stop, step)
checkType('Module:Array.range', 1, start, 'number')
checkType('Module:Array.range', 2, stop, 'number', true)
checkType('Module:Array.range', 3, step, 'number', true)
local array = setmetatable({}, arr)
local len = 0
if not stop then
stop = start
start = 1
end
for i = start, stop, step or 1 do
len = len + 1
array[len] = i
end
return array
end
function arr.reduce(array, fn, accumulator)
checkType('Module:Array.reduce', 1, array, 'table')
checkType('Module:Array.reduce', 2, fn, 'function')
local acc = accumulator
local i = 1
if acc == nil then
acc = array[1]
i = 2
end
while array[i] ~= nil do
acc = fn(array[i], acc, i)
i = i + 1
end
return acc
end
function arr.reject(array, fn)
checkType('Module:Array.reject', 1, array, 'table')
checkTypeMulti('Module:Array.reject', 2, fn, {'function', 'table', 'number', 'boolean'})
if fn == nil then fn = function(item) return item end end
if type(fn) ~= 'function' and type(fn) ~= 'table' then
fn = {fn}
end
local r = setmetatable({}, getmetatable(array))
local len = 0
if type(fn) == 'function' then
local i = 1
while array[i] ~= nil do
if not fn(array[i], i) then
len = len + 1
r[len] = array[i]
end
i = i + 1
end
else
local rejectMap = {}
arr.each(fn, function(item) rejectMap[item] = true end)
local i = 1
while array[i] ~= nil do
if not rejectMap[array[i]] then
len = len + 1
r[len] = array[i]
end
i = i + 1
end
end
return r
end
function arr.rep(val, n)
checkType('Module:Array.rep', 2, n, 'number')
local r = setmetatable({}, arr)
for i = 1, n do
r[i] = val
end
return r
end
function arr.scan(array, fn, accumulator)
checkType('Module:Array.scan', 1, array, 'table')
checkType('Module:Array.scan', 2, fn, 'function')
local acc = accumulator
local r = setmetatable({}, getmetatable(array))
local i = 1
while array[i] ~= nil do
if i == 1 and not accumulator then
acc = array[i]
else
acc = fn(array[i], acc)
end
r[i] = acc
i = i + 1
end
return r
end
function arr.slice(array, start, finish)
checkType('Module:Array.slice', 1, array, 'table')
checkType('Module:Array.slice', 2, start, 'number', true)
checkType('Module:Array.slice', 3, finish, 'number', true)
start = start or 1
finish = finish or #array
if start < 0 and finish == nil then
finish = #array + start
start = 1
elseif start < 0 then
start = #array + start
end
if finish < 0 then
finish = #array + finish
end
local r = setmetatable({}, getmetatable(array))
local len = 0
for i = start, finish do
len = len + 1
r[len] = array[i]
end
return r
end
function arr.split(array, count)
checkType('Module:Array.split', 1, array, 'table')
checkType('Module:Array.split', 2, count, 'number')
local x = setmetatable({}, getmetatable(array))
local y = setmetatable({}, getmetatable(array))
for i = 1, #array do
table.insert(i <= count and x or y, array[i])
end
return x, y
end
function arr.sum(array)
checkType('Module:Array.sum', 1, array, 'table')
local res = 0
for i = 1, #array do
res = res + array[i]
end
return res
end
function arr.take(array, count, offset)
checkType('Module:Array.take', 1, array, 'table')
checkType('Module:Array.take', 2, count, 'number')
checkType('Module:Array.take', 3, offset, 'number', true)
local x = setmetatable({}, getmetatable(array))
for i = offset or 1, #array do
if i <= count then
table.insert(x, array[i])
end
end
return x
end
function arr.take_every(array, n, offset)
checkType('Module:Array.take_every', 1, array, 'table')
checkType('Module:Array.take_every', 2, n, 'number')
checkType('Module:Array.take_every', 3, offset, 'number', true)
local r = setmetatable({}, getmetatable(array))
local len = 0
local i = offset or 1
while array[i] ~= nil do
len = len + 1
r[len] = array[i]
i = i + n
end
return r
end
function arr.unique(array, fn)
checkType('Module:Array.unique', 1, array, 'table')
checkType('Module:Array.unique', 2, fn, 'function', true)
fn = fn or function(item) return item end
local r = setmetatable({}, getmetatable(array))
local len = 0
local hash = {}
local i = 1
while array[i] ~= nil do
local id = fn(array[i])
if not hash[id] then
len = len + 1
r[len] = array[i]
hash[id] = true
end
i = i + 1
end
return r
end
function arr.update(array, indexes, values)
checkType('Module:Array.update', 1, array, 'table')
checkTypeMulti('Module:Array.update', 2, indexes, {'table', 'number'})
if type(indexes) == 'number' then
indexes = {indexes}
end
if type(values) == 'table' then
assert(#indexes == #values, 'Values array must be of equal length as index array')
for i = 1, #indexes do
array[indexes[i]] = values[i]
end
else
for i = 1, #indexes do
array[indexes[i]] = values
end
end
return array
end
function arr.zip(...)
local arrays = { ... }
checkType('Module:Array.zip', 1, arrays[1], 'table')
local r = setmetatable({}, getmetatable(arrays[1]))
local _, longest = arr.max_by(arrays, function(array) return #array end)
for i = 1, longest do
local q = {}
for j = 1, #arrays do
table.insert(q, arrays[j][i])
end
table.insert(r, q)
end
return r
end
return arr
-- </nowiki>
c4591b9adad703234f1c2be6ea1ca501278072cf
模块:Format link
828
609
1781
2023-03-12T06:43:42Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) then
local success, exists = pcall(function() return title.exists end)
if success and not exists then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
1253bdd2683ee4badc33856bfd5499b09a7dca1f
模板:Hatnote/doc
10
610
1782
2023-03-12T06:43:42Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{t|Hatnote}} is a simple notice template intended for use posting editorial notes in articles. Note that the user should supply a short bolded description of what kind of editorial note this is.
;Sample Output:
<nowiki>{{Note|'''Note:''' This is an editorial comment.}}</nowiki>
;Results in:
{{Note|'''Note:''' This is an editorial comment.}}
;Sample Output:
<nowiki>{{Note|'''Errata:''' Correction to this comm-link (include reference to source).}}</nowiki>
;Results in:
{{Note|'''Errata:''' Correction to this comm-link (include reference to source).}}
<includeonly>[[Category:General wiki templates|{{PAGENAME}}]]</includeonly>
9432e97500203661124944eda168a9c9637e6a57
模板:Extension DPL
10
589
1761
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<noinclude>This page was automatically created. It serves as an anchor page for all '''[[Special:WhatLinksHere/Template:Extension_DPL|invocations]]''' of [http://mediawiki.org/wiki/Extension:DynamicPageList3 Extension:DynamicPageList3 (DPL)].</noinclude>
df8ef5a165ada25e5e768247d0f2a94ee1102655
模块:Template link general
828
613
1785
2023-03-12T06:59:21Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " → " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
模板:Template link general/doc
10
614
1786
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{tsh|{{{1|tlg}}}|{{{2|}}}}}
This template, often abbreviated as {{tlf|{{#switch:{{lc:{{ROOTPAGENAME}}}}
| tlg | template link general = tlg
| tlb | template link with bold = tlb
| tlc | template link code = tlc
| tlw ||template link with linked braces = tlw
| tlf | template link with link off = tlf
| tltss | template link with title span, subst = tltss
| tlx | template link expanded = tlx
| tlxb | template link expanded with bold = tlxb
| tlxi | template link expanded with italic = tlxi
| tlxs | template link expanded with subst = tlxs
| tls | template link with subst = tls
| tnull | template link null = tnull
| tlp | template link with parameters = tlp}}
}}, is used to provide stylized formatting to template displays without actually using the template itself.
===Parameters===
With the exception of {{mono|alttext}}, the named parameters are toggles that are either omitted (default in most cases) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order ([[#Examples|see Examples below]]). Certain templates have the parameter "on" by default; see [[#General-purpose formatting|the main table]] for all alternate options.
{| class="wikitable"
! Parameter || Action || Use with<br>{{t|example}} || Default active
|-
| || Default (without accessory parameters) || {{tlg|example}} ||
|-
| brace || Include braces as part of the template link || {{tlg|brace=yes|example}} || {{tl|tlw}}/{{tl|tn}}
|-
| braceinside || Include innermost braces as part of the template link || {{tlg|example|braceinside=yes}} ||
|-
| bold || Renders the template link/name in '''bold''' || {{tlg|bold=yes|example}} || {{tl|tlb}}, {{tl|tlxb}}
|-
| code || Display output using HTML [[HTML element#code|{{tag|code}}]] tags ([[monospaced font]]) || {{tlg|code=yes|example}} || {{tl|tlc}}, {{tl|Template link expanded}}, etc.
|-
| italic || Display any parameters accompanying the template link/name in ''italics'' ||| {{tlg|italic=yes|example|param}} || {{tl|tlxi}}
|-
| kbd || Display output using HTML [[HTML element#kbd|{{tag|kbd}}]] tags (monospaced font) || {{tlg|kbd=yes|example}} ||
|-
| nolink || Don't render the template name as a link || {{tlg|nolink=yes|example}} || {{tl|tlf}}, {{t|tnull}}
|-
| nowrap || Prevent the insertion of line breaks ([[word wrap]]) in the output || {{tlg|nowrap=yes|example}} ||
|-
| nowrapname || Prevent word wrapping in the output of template name/link (parameters will wrap if needed) || {{tlg|nowrapname=yes|example}} ||
|-
| plaincode || Uses {{tag|code|params=style="border:none; background:transparent;"}} || {{tlg|plaincode=yes|example}} || {{tl|tltss}}
|-
| subst || Include a [[Help:Substitution|subst:]] prefix before the template link/name || {{tlg|subst=yes|example}} || {{tl|tls}}, {{tl|tlxs}}, etc
|-
| {{para|alttext|[text]}} || Use [text] as the label for the template link || {{tlg|alttext=Other|example}} || {{tl|tla}}
|-
| _show_result || Will also display the result of the template. || {{tlx|Min|7|-5|_show_result=y}} ||
|-
| _expand || Will add a link to the expanded template page. || {{tlx|Min|7|-5|_expand=y}} ||
|}
<includeonly>
<!-- Category -->
[[Category:Internal link templates]]
[[Category:Typing-aid templates]]
</includeonly>
bcc8a8da870e76ae70ee2fba3a921a6b991dff36
模块:Template link general/doc
828
617
1789
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
Implements {{Tl|Template link general}} and other templates in its family
3d33857697946f3daa8224976687a7bd50e9635f
模板:Template link with link off
10
619
1791
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{/doc}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
1616655857f270ddf2995fca08b2605775a1240e
模板:Template link expanded
10
620
1792
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{/doc}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
f49d86d852e8c15c4ffa3f08e7f33ddfb0920b22
模板:Template link expanded with subst
10
621
1793
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on|subst=on}}<noinclude>
{{/doc}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
f6f2c2d16cacf00e6dbfea86c7e28bcc193d64e1
模板:Template shortcut
10
622
1794
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main|template=yes}}</includeonly><noinclude>{{/doc}}</noinclude>
dfcc5bcf8e92cf515f38978ed3982de424ff81ae
模板:Tlx
10
623
1795
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
155e901040104f96908f1f4627c4eb3501301bf9
模板:Tsh
10
624
1796
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template shortcut]]
2b347168829fa3dac97428789e4ddfa93e1e891c
模块:List
828
625
1797
2023-03-12T06:59:21Z
Pio
2
导入1个版本
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
模块:TableTools
828
626
1798
2023-03-12T06:59:21Z
Pio
2
导入1个版本
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
if type(v) == 'number' and tostring(v) == '-nan' then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
return s
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
return p
ab9df0eb210b08945b9eed86435858f6e931a79a
模板:No redirect
10
627
1799
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{{{{|safesubst:}}}#if: {{{{{|safesubst:}}}#invoke:Redirect|isRedirect|{{{1}}}}}
| <span class="plainlinks">[{{{{{|safesubst:}}}fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
| {{{{{|safesubst:}}}#if:{{{2|}}}|[[:{{{{{|safesubst:}}}FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{{{{|safesubst:}}}FULLPAGENAME:{{{1}}}}}]]}}
}}<noinclude>
{{/doc}}
</noinclude>
4ed938fb734829a07121a066d2b85a8197e03247
模块:Redirect
828
628
1800
2023-03-12T06:59:21Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module provides functions for getting the target of a redirect page.
local p = {}
-- Gets a mw.title object, using pcall to avoid generating script errors if we
-- are over the expensive function count limit (among other possible causes).
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
return string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
end
-- Gets the target of a redirect. If the page specified is not a redirect,
-- returns nil.
function p.getTarget(page, fulltext)
-- Get the title object. Both page names and title objects are allowed
-- as input.
local titleObj
if type(page) == 'string' or type(page) == 'number' then
titleObj = getTitle(page)
elseif type(page) == 'table' and type(page.getContent) == 'function' then
titleObj = page
else
error(string.format(
"bad argument #1 to 'getTarget'"
.. " (string, number, or title object expected, got %s)",
type(page)
), 2)
end
if not titleObj or not titleObj.isRedirect then
return nil
end
-- Find the target by using string matching on the page content.
local target = p.getTargetFromText(titleObj:getContent() or "")
if target then
local targetTitle = getTitle(target)
if targetTitle then
if fulltext then
return targetTitle.fullText
else
return targetTitle.prefixedText
end
else
return nil
end
else
-- The page is a redirect, but matching failed. This indicates a bug in
-- the redirect matching pattern, so throw an error.
error(string.format(
'could not parse redirect on page "%s"',
fulltext and titleObj.fullText or titleObj.prefixedText
))
end
end
--[[
-- Given a single page name determines what page it redirects to and returns the
-- target page name, or the passed page name when not a redirect. The passed
-- page name can be given as plain text or as a page link.
--
-- Returns page name as plain text, or when the bracket parameter is given, as a
-- page link. Returns an error message when page does not exist or the redirect
-- target cannot be determined for some reason.
--]]
function p.luaMain(rname, bracket, fulltext)
if type(rname) ~= "string" or not rname:find("%S") then
return nil
end
bracket = bracket and "[[%s]]" or "%s"
rname = rname:match("%[%[(.+)%]%]") or rname
local target = p.getTarget(rname, fulltext)
local ret = target or rname
ret = getTitle(ret)
if ret then
if fulltext then
ret = ret.fullText
else
ret = ret.prefixedText
end
return bracket:format(ret)
else
return nil
end
end
-- Provides access to the luaMain function from wikitext.
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
return p.luaMain(args[1], args.bracket, args.fulltext) or ''
end
-- Returns true if the specified page is a redirect, and false otherwise.
function p.luaIsRedirect(page)
local titleObj = getTitle(page)
if not titleObj then
return false
end
if titleObj.isRedirect then
return true
else
return false
end
end
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes'
-- if the specified page is a redirect, and the blank string otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
if p.luaIsRedirect(args[1]) then
return 'yes'
else
return ''
end
end
return p
58c46e7875f08820a7b9301cb8b7c95062c8405b
模块:Shortcut
828
629
1801
2023-03-12T06:59:21Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module implements {{shortcut}}.
-- Set constants
local CONFIG_MODULE = 'Module:Shortcut/config'
-- Load required modules
local checkType = require('libraryUtil').checkType
local yesno = require('Module:Yesno')
local p = {}
local function message(msg, ...)
return mw.message.newRawMessage(msg, ...):plain()
end
local function makeCategoryLink(cat)
return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat)
end
function p._main(shortcuts, options, frame, cfg)
checkType('_main', 1, shortcuts, 'table')
checkType('_main', 2, options, 'table', true)
options = options or {}
frame = frame or mw.getCurrentFrame()
cfg = cfg or mw.loadData(CONFIG_MODULE)
local templateMode = options.template and yesno(options.template)
local redirectMode = options.redirect and yesno(options.redirect)
local isCategorized = not options.category or yesno(options.category) ~= false
-- Validate shortcuts
for i, shortcut in ipairs(shortcuts) do
if type(shortcut) ~= 'string' or #shortcut < 1 then
error(message(cfg['invalid-shortcut-error'], i), 2)
end
end
-- Make the list items. These are the shortcuts plus any extra lines such
-- as options.msg.
local listItems = {}
for i, shortcut in ipairs(shortcuts) do
local templatePath, prefix
if templateMode then
-- Namespace detection
local titleObj = mw.title.new(shortcut, 10)
if titleObj.namespace == 10 then
templatePath = titleObj.fullText
else
templatePath = shortcut
end
prefix = options['pre' .. i] or options.pre or ''
end
if options.target and yesno(options.target) then
listItems[i] = templateMode
and string.format("{{%s[[%s|%s]]}}", prefix, templatePath, shortcut)
or string.format("[[%s]]", shortcut)
else
listItems[i] = frame:expandTemplate{
title = 'No redirect',
args = templateMode and {templatePath, shortcut} or {shortcut, shortcut}
}
if templateMode then
listItems[i] = string.format("{{%s%s}}", prefix, listItems[i])
end
end
end
table.insert(listItems, options.msg)
-- Return an error if we have nothing to display
if #listItems < 1 then
local msg = cfg['no-content-error']
msg = string.format('<strong class="error">%s</strong>', msg)
if isCategorized and cfg['no-content-error-category'] then
msg = msg .. makeCategoryLink(cfg['no-content-error-category'])
end
return msg
end
local root = mw.html.create()
root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Shortcut/styles.css'} })
-- Anchors
local anchorDiv = root
:tag('div')
:addClass('module-shortcutanchordiv')
for i, shortcut in ipairs(shortcuts) do
local anchor = mw.uri.anchorEncode(shortcut)
anchorDiv:tag('span'):attr('id', anchor)
end
-- Shortcut heading
local shortcutHeading
do
local nShortcuts = #shortcuts
if nShortcuts > 0 then
local headingMsg = options['shortcut-heading'] or
redirectMode and cfg['redirect-heading'] or
cfg['shortcut-heading']
shortcutHeading = message(headingMsg, nShortcuts)
shortcutHeading = frame:preprocess(shortcutHeading)
end
end
-- Shortcut box
local shortcutList = root
:tag('div')
:addClass('module-shortcutboxplain noprint')
:attr('role', 'note')
if options.float and options.float:lower() == 'left' then
shortcutList:addClass('module-shortcutboxleft')
end
if options.clear and options.clear ~= '' then
shortcutList:css('clear', options.clear)
end
if shortcutHeading then
shortcutList
:tag('div')
:addClass('module-shortcutlist')
:wikitext(shortcutHeading)
end
local ubl = require('Module:List').unbulleted(listItems)
shortcutList:wikitext(ubl)
return tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
-- Separate shortcuts from options
local shortcuts, options = {}, {}
for k, v in pairs(args) do
if type(k) == 'number' then
shortcuts[k] = v
else
options[k] = v
end
end
-- Compress the shortcut array, which may contain nils.
local function compressArray(t)
local nums, ret = {}, {}
for k in pairs(t) do
nums[#nums + 1] = k
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
shortcuts = compressArray(shortcuts)
return p._main(shortcuts, options, frame)
end
return p
03fd46a265e549852a9ed3d3a9249b247d84cb4f
模块:Shortcut/config
828
630
1802
2023-03-12T06:59:21Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module holds configuration data for [[Module:Shortcut]].
return {
-- The heading at the top of the shortcut box. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['shortcut-heading'] = '[[Star_Citizen:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]',
-- The error message to display when a shortcut is invalid (is not a string, or
-- is the blank string). It accepts the following parameter:
-- $1 - the number of the shortcut in the argument list. (required)
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' ..
'strings of at least one character in length)',
-- The error message to display when no shortcuts or other displayable content
-- were specified. (required)
['no-content-error'] = 'Error: no shortcuts were specified and the ' ..
mw.text.nowiki('|msg=') ..
' parameter was not set.',
-- A category to add when the no-content-error message is displayed. (optional)
['no-content-error-category'] = 'Shortcut templates with missing parameters',
}
3423f6200db61192f2854ceee77baccde6585262
模板:Tag
10
631
1803
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<code class="{{#ifeq:{{{wrap|}}}|yes|wrap|nowrap}}" style="{{#ifeq:{{{style|}}}|plain|border:none;background:transparent;|{{{style|}}}}}"><!--
Opening tag
-->{{#switch:{{{2|pair}}}
|c|close =
|s|single
|o|open
|p|pair = <{{{1|tag}}}{{#if:{{{params|}}}| {{{params}}}}}
}}<!--
Content between tags
-->{{#switch:{{{2|pair}}}
|c|close = {{{content|}}}
|s|single =  />
|o|open = >{{{content|}}}
|p|pair = {{#ifeq:{{{1|tag}}}|!--||>}}{{{content|...}}}
}}<!--
Closing tag
-->{{#switch:{{{2|pair}}}
|s|single
|o|open =
|c|close
|p|pair = {{#ifeq:{{{1|tag}}}|!--|-->|</{{{1|tag}}}>}}
}}<!--
--></code><noinclude>
{{/doc}}
</noinclude>
8ebd5733c5338eba4273b22018450aff3008cfa8
模板:Tlf
10
632
1804
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
e01bff5c127e5c415217e27ed21b73c36ec4f5d4
模板:Para
10
633
1805
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<code class="nowrap" {{#if:{{{plain|}}}|style="border:none;background-color:inherit;color:inherit;"}}>|{{#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>{{/doc}}</noinclude>
6163a3fc44e282b3fb0f5105eec0837218d8fac9
模板:Mono
10
634
1806
2023-03-12T06:59:21Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<span style="font-family: monospace, monospace;">{{{2|{{{1}}}}}}</span><noinclude>
{{/doc}}</noinclude>
cc63ba82b36133e3d6b10a31c35d17158b223395
模板:Tlg
10
636
1808
2023-03-12T06:59:22Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link general]]
9842c9284f318753d4aa6ab9ac9aff29acbbbb59
模板:Format link/doc
10
638
1810
2023-03-12T07:04:22Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This template formats a link for use in hatnote templates. It accepts up to three positional parameters, the link, an optional display value, and an optional target override (which if provided, makes the link parameter optional). These parameters may also be supplied by name, as <var>link</var>, <var>display</var>, and <var>target</var> respectively. Links to categories and files are automatically escaped with the [https://en.wikipedia.org/wiki/Help:Colon_trick colon trick], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
This template doesn't work with [https://en.wikipedia.org/wiki/Wikipedia:Substitution subst].
== Usage ==
'''Link only:'''
{{tlc|format link|''link''}}
'''Link plus display:'''
{{tlc|format link|''link''|''display''}}
'''Link with an italicized page name:'''
{{tlc|format link|''link''|3=italicizepage=yes}}
'''Link with an italicized section name:'''
{{tlc|format link|''link''|3=italicizesection=yes}}
If the link or display values contain an equals sign, you will need to specify the parameter names like this:
{{tlc|format link|2=1=''link''|3=2=''display''}}
'''Link with a target override:'''
{{tlc|format link|''link''|''display''|''target''}}
'''Link with parameters supplied by name:'''
{{tlc|format link|2=link=''link''|3=display=''display''|4=target=''target''}}
== Examples ==
* {{tlc|format link|Lion}} → <nowiki>[[Lion]]</nowiki> → {{format link|Lion}}
* {{tlc|format link|Lion#Etymology}} → <nowiki>[[Lion#Etymology|Lion §&nbsp;Etymology]]</nowiki> → {{format link|Lion#Etymology}}
* {{tlc|format link|Category:Lions}} → <nowiki>[[:Category:Lions]]</nowiki> → {{format link|Category:Lions}}
* {{tlc|format link|Lion#Etymology|Etymology of lion}} → <nowiki>[[Lion#Etymology|Etymology of lion]]</nowiki> → {{format link|Lion#Etymology|Etymology of lion}}
* {{tlc|format link|#Bar||Foo#Bar}} → <nowiki>[[:Foo#Bar|§&nbsp;Bar]]</nowiki> → {{format link|#Bar||Foo#Bar}}
* {{tlc|format link|Quo warranto#Philippines|3=italicizepage=true}} → <nowiki>[[Quo warranto#Philippines|<i>Quo warranto</i> §&nbsp;Philippines]]</nowiki> → {{format link|Quo warranto#Philippines|italicizepage=true}}
* {{tlc|format link|Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|3=italicizesection=true}} → <nowiki>[[Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|Cybercrime Prevention Act of 2012 §&nbsp;<i>Disini v. Secretary of Justice</i>]]</nowiki> → {{format link|Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|italicizesection=true}}
* {{tlc|format link}} → {{format link|category=no}}
== Errors ==
If this template is used and neither the <var>link</var> parameter (or positional parameter 1) nor the <var>target</var> parameter (or positional parameter 3) is supplied, then the template will return an error message. At least one of those must be supplied.
<includeonly>
<!-- Categories -->
[[Category:Internal link templates]]
</includeonly>
182a3082d8201806a45045854a2580dadd8bd73e
模板:Tlc
10
639
1811
2023-03-12T07:04:22Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link code]]
be5d6275ea41d83224503e05901f3405c82141f7
模块:Error
828
640
1812
2023-03-12T07:04:22Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module implements {{error}}.
local p = {}
local function _error(args)
local tag = mw.ustring.lower(tostring(args.tag))
-- Work out what html tag we should use.
if not (tag == 'p' or tag == 'span' or tag == 'div') then
tag = 'strong'
end
-- Generate the html.
return tostring(mw.html.create(tag)
:addClass('error')
:wikitext(tostring(args.message or args[1] or error('no message specified', 2)))
)
end
function p.error(frame)
local args
if type(frame.args) == 'table' then
-- We're being called via #invoke. The args are passed through to the module
-- from the template page, so use the args that were passed into the template.
args = frame.args
else
-- We're being called from another module or from the debug console, so assume
-- the args are passed in directly.
args = frame
end
-- if the message parameter is present but blank, change it to nil so that Lua will
-- consider it false.
if args.message == "" then
args.message = nil
end
return _error(args)
end
return p
f77bd720c216b5626efe795d3b49462d50971f7d
模板:Format link
10
641
1813
2023-03-12T07:04:22Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{{{{|safesubst:}}}#invoke:format link|formatLink}}</includeonly><noinclude>
{{/doc}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
6cb2c0414625589fc6125beac624529903d938f4
模块:Format link/doc
828
642
1814
2023-03-12T07:04:22Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This module, migrated from origins in [[Module:Hatnote]], provides functionality for formatting links for display, including that powering the {{tl|format link}} template.
It can pretty-format section links with the section symbol ("§") and appropriate whitespace, it automatically escapes category and file names with the [[Help:Colon trick|colon trick]], and includes functionality for italicizing the page or section name, and for detecting and categorizing results that produce [[Wikipedia:Red link|red links]].
== Use from wikitext ==
The functions in this module cannot be used directly from #invoke, and must be used through templates instead. Please see [[Template:Format link]] for documentation on usage of that template.
== Use from other Lua modules==
To load this module from another Lua module, use the following code:
<syntaxhighlight lang="lua">
local mFormatLink = require('Module:Format link')
</syntaxhighlight>
You can then use the functions as documented below.
=== _formatLink ===
<syntaxhighlight lang="lua">
mFormatLink._formatLink{
link = 'Link',
display = 'Display',
target = 'Target',
italicizePage = true,
italicizeSection = true,
categorizeMissing = 'Pages using formatted red links'
}
</syntaxhighlight>
Formats <var>link</var> as a wikilink. Categories and files are automatically escaped with the [[Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
Several options modify the output:
* If the <var>display</var> value is present, then it will be used as a display value. Any manual piping (using the <code><nowiki>{{!}}</nowiki></code> magic word or similar) present in <var>link</var> will be overridden by the <var>display</var> value if present.
* If the <var>target</var> value is present, then it will override <var>link</var> as a target, but the result will still be ''displayed'' using either the value from <var>display</var>, or the result of formatting <var>link</var>.
* If <var>italicizePage</var> is true, then the page portion of the link is italicized if present.
* If <var>italicizeSection</var> is true, then the section portion of the link is italicized if present.
* If <var>categorizeMissing</var> is a non-empty string, then that value is used as a category name, and that category will be applied if the resulting target of the link (no matter whether through <var>link</var> or through <var>target</var>) doesn't exist.
;Examples:
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'Foo#Bar'}</syntaxhighlight> → <nowiki>[[:Foo#Bar|Foo §&nbsp;Bar]]</nowiki> → {{format link|Foo#Bar}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'Baz', display = 'Qux'}</syntaxhighlight> → <nowiki>[[:Baz|Qux]]</nowiki> → {{format link|Baz|Qux}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'Foo|Bar', display = 'Baz'}</syntaxhighlight> → <nowiki>[[:Foo|Baz]]</nowiki> → {{format link|Foo{{!}}Bar|Baz}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = '#Foo', target = 'Example#Foo'}</syntaxhighlight> → <nowiki>[[:Example#Foo|§&nbsp;Foo]]</nowiki> → {{format link|#Foo||Example#Foo}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'The Lord of the Rings#Plot', italicizePage = true}</syntaxhighlight> → <nowiki>[[:The Lord of the Rings#Plot|''The Lord of the Rings'' §&nbsp;Plot]]</nowiki> → {{format link|The Lord of the Rings#Plot|italicizepage=true}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice', italicizeSection = true}</syntaxhighlight> → <nowiki>[[:Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|Cybercrime Prevention Act of 2012 §&nbsp;''Disini v. Secretary of Justice'']]</nowiki> → {{format link|Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|italicizesection=true}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'Nonexistent page', categorizeMissing = 'Example'}</syntaxhighlight> → <nowiki>[[:Nonexistent page]][[Category:Example]]</nowiki> → {{format link|Nonexistent page}}
: <syntaxhighlight lang="lua" inline>mFormatLink._formatLink{link = 'Existing', categorizeMissing = 'Example'}</syntaxhighlight> → <nowiki>[[:Existing]]</nowiki> → {{format link|Existing}}
=== formatPages ===
<syntaxhighlight lang="lua">
mFormatLink.formatPages(options, pages)
</syntaxhighlight>
This derived function is useful for lists that format many links. It formats an array of pages using the [[#_formatLink|_formatLink]] function, and returns the result as an array. Options in the <var>options</var> table are applied, and use the same names as the options for <var>_formatLink</var>.
;Example
:{{code|<nowiki>mFormatLink.formatPages({categorizeMissing = 'Example'}, {'Foo#Bar', 'Nonexistent page'})</nowiki>|lua}} → {{code|<nowiki>{'[[:Foo#Bar|Foo § Bar]]', '[[:Nonexistent page]][[Category:Example]]'}</nowiki>|lua}}
== Errors ==
If <var>_formatLink</var> is used and neither a <var>link</var> nor a <var>target</var> argument is provided, then the module will produce an error message instead of its usual output, as it ''cannot'' then produce valid output.
You can solve this error by providing appropriate parameters to <var>_formatLink</var>, or you may want to ensure that a more descriptive error is provided by a downstream template or module when it would otherwise call <var>_formatLink</var> with inadequate arguments.
586e5cbc02b72fda227bb07c49a2b881330ca0a3
模块:Infobox
828
582
1754
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
-- local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- https://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_musical_artist&oldid=849054481
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
----:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
----:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
--:css('text-align', 'center')
--:css('font-size', '125%')
--:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
--:css('text-align', 'center')
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
--local function renderNavBar()
-- if not args.name then return end
--
-- root
-- :tag('tr')
-- :tag('td')
-- :attr('colspan', '2')
-- --:css('text-align', 'right')
-- :wikitext(navbar{
-- args.name,
-- mini = 1,
-- })
--end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if args.child == 'yes' then
if args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass((args.subbox ~= 'yes') and 'infobox' or nil)
:addClass(args.bodyclass)
--if args.subbox == 'yes' then
--root
--:css('padding', '0')
--:css('border', 'none')
--:css('margin', '-3px')
--:css('width', 'auto')
--:css('min-width', '100%')
--:css('font-size', '100%')
--:css('clear', 'none')
--:css('float', 'none')
--:css('background-color', 'transparent')
--else
--root
--:css('width', '400px') -- Changed from 22em
--end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
--renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return _infobox()
end
return p
2057ca88f291fe0254ce53758ae9c331c4487421
模块:Redirect hatnote
828
645
1817
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--[[
-- This module produces a "redirect" hatnote. It looks like this:
-- '"X" redirects here. For other uses, see Y.'
-- It implements the {{redirect}} template.
--]]
local mHatnote = require('Module:Hatnote')
local mHatList = require('Module:Hatnote list')
local mArguments --lazily initialize
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
local p = {}
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
function p.redirect(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly=true})
--Get number of redirects
local numRedirects = tonumber(frame.args[1]) or 1
-- Create the options table.
local options = {}
options.selfref = args.selfref
return p._redirect(args, numRedirects, options)
end
function p._redirect(args, numRedirects, options, currentTitle, redirectTitle, targetTitle)
-- Validate the input. Don't bother checking currentTitle, redirectTitle or
-- targetTitle, as they are only used in testing.
checkType('_redirect', 1, args, 'table')
checkType('_redirect', 2, numRedirects, 'number', true)
numRedirects = numRedirects or 1
checkType('_redirect', 3, options, 'table', true)
options = options or {}
currentTitle = currentTitle or mw.title.getCurrentTitle()
-- Get the table of redirects
local redirect = {}
for i = 1, numRedirects do
-- Return an error if a redirect parameter is missing.
if not args[i] then
return mHatnote.makeWikitextError(
'missing redirect parameter',
'Template:Redirect#Errors',
args.category
)
end
redirect[i] = args[i]
end
-- Generate the text.
local formattedRedirect = {}
for k,v in pairs(redirect) do
formattedRedirect[k] = '"' .. v .. '"'
end
local text = {
mHatList.andList(formattedRedirect) .. ' ' .. (#redirect == 1 and 'redirects' or 'redirect') .. ' here.',
mHatList._forSee(args, #redirect + 1, {title = redirect[1], extratext = args.text})
}
text = table.concat(text, ' ')
-- Functionality for adding categories
local categoryTable = {}
function addCategory(cat)
if cat and cat ~= '' then
-- Add by index to avoid duplicates
categoryTable[string.format('[[Category:%s]]', cat)] = true
end
end
--Generate tracking categories
local mhOptions = {}
for k,v in pairs(redirect) do
-- We don't need a tracking category if the template invocation has been
-- copied directly from the docs, or if we aren't in main- or category-space.
if not v:find('^REDIRECT%d*$') and v ~= 'TERM' --
and currentTitle.namespace == 0 or currentTitle.namespace == 14
then
redirectTitle = redirectTitle or getTitle(v)
if not redirectTitle or not redirectTitle.exists then
addCategory('Missing redirects')
elseif not redirectTitle.isRedirect then
addCategory('Articles with redirect hatnotes needing review')
else
local mRedirect = require('Module:Redirect')
local target = mRedirect.getTarget(redirectTitle)
targetTitle = targetTitle or target and getTitle(target)
if targetTitle and targetTitle ~= currentTitle then
addCategory('Articles with redirect hatnotes needing review')
end
end
end
-- Generate the options to pass to [[Module:Hatnote]].
if currentTitle.namespace == 0 and not mhOptions.selfref
and redirectTitle and redirectTitle.namespace ~= 0
then
-- We are on a mainspace page, and the hatnote starts with something
-- like "Wikipedia:Foo redirects here", so automatically label it as
-- a self-reference.
mhOptions.selfref = true
else
mhOptions.selfref = options.selfref
end
end
--concatenate all the categories
local category = ''
for k,v in pairs(categoryTable) do
category = category .. k
end
mhOptions.icon = 'WikimediaUI-ArticleDisambiguation-ltr.svg'
return mHatnote._hatnote(text, mhOptions) .. category
end
return p
35131c2f336571a8c63e89d2c9ad56f2a8e9249f
模块:About
828
646
1818
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
local mArguments --initialize lazily
local mHatnote = require('Module:Hatnote')
local mHatList = require('Module:Hatnote list')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.about (frame)
-- A passthrough that gets args from the frame and all
mArguments = require('Module:Arguments')
args = mArguments.getArgs(frame)
return p._about(args)
end
function p._about (args, options)
-- Produces "about" hatnote.
-- Type checks and defaults
checkType('_about', 1, args, 'table', true)
args = args or {}
checkType('_about', 2, options, 'table', true)
options = options or {}
local defaultOptions = {
aboutForm = 'This %s is about %s. ',
PageType = require('Module:Pagetype').main(),
namespace = mw.title.getCurrentTitle().namespace,
otherText = nil, --included for complete list
sectionString = 'section'
}
for k, v in pairs(defaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Set initial "about" string
local pageType = (args.section and options.sectionString) or options.PageType
local about = ''
if args[1] then
about = string.format(options.aboutForm, pageType, args[1])
end
--Allow passing through certain options
local fsOptions = {
otherText = options.otherText,
extratext = args.text
}
local hnOptions = {
selfref = args.selfref,
icon = 'WikimediaUI-ArticleDisambiguation-ltr.svg'
}
-- Set for-see list
local forSee = mHatList._forSee(args, 2, fsOptions)
-- Concatenate and return
return mHatnote._hatnote(about .. forSee, hnOptions)
end
return p
2735737454c9e4ecf5675f75f802fe77722e75ca
模块:String
828
647
1819
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} );
local s = new_args['s'] or '';
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } );
local s = new_args['s'] or '';
local i = tonumber( new_args['i'] ) or 1;
local j = tonumber( new_args['j'] ) or -1;
local len = mw.ustring.len( s );
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1;
end
if j < 0 then
j = len + j + 1;
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' );
end
if j < i then
return str._error( 'String subset indices out of order' );
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|pos|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} );
local s = new_args['s'] or '';
local start = tonumber( new_args['start'] ) or 1;
local plain_flag = str._getBoolean( new_args['plain'] or false );
local pattern = new_args['pattern'] or '';
local match_index = math.floor( tonumber(new_args['match']) or 1 );
local nomatch = new_args['nomatch'];
if s == '' then
return str._error( 'Target string is empty' );
end
if pattern == '' then
return str._error( 'Pattern string is empty' );
end
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' );
end
if match_index == 0 then
return str._error( 'Match index is out of range' );
end
if plain_flag then
pattern = str._escapePattern( pattern );
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start );
end
local iterator = mw.ustring.gmatch(s, pattern);
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1;
if match_index == 0 then
result = w;
break;
end
end
else
-- Reverse search
local result_table = {};
local count = 1;
for w in iterator do
result_table[count] = w;
count = count + 1;
end
result = result_table[ count + match_index ];
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' );
else
return nomatch;
end
else
return result;
end
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} );
local target_str = new_args['target'] or '';
local pos = tonumber( new_args['pos'] ) or 0;
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' );
end
return mw.ustring.sub( target_str, pos, pos );
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} );
local source_str = new_args['source'] or '';
local target_str = new_args['target'] or '';
if target_str == '' then
return 1;
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } );
local source_str = new_args['source'] or '';
local pattern = new_args['target'] or '';
local start_pos = tonumber(new_args['start']) or 1;
local plain = new_args['plain'] or true;
if source_str == '' or pattern == '' then
return 0;
end
plain = str._getBoolean( plain );
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } );
local source_str = new_args['source'] or '';
local pattern = new_args['pattern'] or '';
local replace = new_args['replace'] or '';
local count = tonumber( new_args['count'] );
local plain = new_args['plain'] or true;
if source_str == '' or pattern == '' then
return source_str;
end
plain = str._getBoolean( plain );
if plain then
pattern = str._escapePattern( pattern );
replace = mw.ustring.gsub( replace, "%%", "%%%%" ); --Only need to escape replacement sequences.
end
local result;
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count );
else
result = mw.ustring.gsub( source_str, pattern, replace );
end
return result;
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {};
local index = 1;
local value;
for i,arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index];
index = index + 1;
end
new_args[arg] = value;
end
return new_args;
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame();
local error_category = frame.args.error_category or 'Errors reported by Module String';
local ignore_errors = frame.args.ignore_errors or false;
local no_category = frame.args.no_category or false;
if str._getBoolean(ignore_errors) then
return '';
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>';
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str;
end
return error_str;
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value;
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower();
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false;
else
boolean_value = true;
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str;
else
error( 'No boolean value found' );
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
return str
b3f731f2026437e7ef7e3f22bb9d823788125c39
模块:NumberSpell
828
649
1821
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module converts a number into its written English form.
-- For example, "2" becomes "two", and "79" becomes "seventy-nine".
local getArgs = require('Module:Arguments').getArgs
local p = {}
local max = 100 -- The maximum number that can be parsed.
local ones = {
[0] = 'zero',
[1] = 'one',
[2] = 'two',
[3] = 'three',
[4] = 'four',
[5] = 'five',
[6] = 'six',
[7] = 'seven',
[8] = 'eight',
[9] = 'nine'
}
local specials = {
[10] = 'ten',
[11] = 'eleven',
[12] = 'twelve',
[13] = 'thirteen',
[15] = 'fifteen',
[18] = 'eighteen',
[20] = 'twenty',
[30] = 'thirty',
[40] = 'forty',
[50] = 'fifty',
[60] = 'sixty',
[70] = 'seventy',
[80] = 'eighty',
[90] = 'ninety',
[100] = 'one hundred'
}
local formatRules = {
{num = 90, rule = 'ninety-%s'},
{num = 80, rule = 'eighty-%s'},
{num = 70, rule = 'seventy-%s'},
{num = 60, rule = 'sixty-%s'},
{num = 50, rule = 'fifty-%s'},
{num = 40, rule = 'forty-%s'},
{num = 30, rule = 'thirty-%s'},
{num = 20, rule = 'twenty-%s'},
{num = 10, rule = '%steen'}
}
function p.main(frame)
local args = getArgs(frame)
local num = tonumber(args[1])
local success, result = pcall(p._main, num)
if success then
return result
else
return string.format('<strong class="error">Error: %s</strong>', result) -- "result" is the error message.
end
return p._main(num)
end
function p._main(num)
if type(num) ~= 'number' or math.floor(num) ~= num or num < 0 or num > max then
error('input must be an integer between 0 and ' .. tostring(max), 2)
end
-- Check for numbers from 0 to 9.
local onesVal = ones[num]
if onesVal then
return onesVal
end
-- Check for special numbers.
local specialVal = specials[num]
if specialVal then
return specialVal
end
-- Construct the number from its format rule.
onesVal = ones[num % 10]
if not onesVal then
error('Unexpected error parsing input ' .. tostring(num))
end
for i, t in ipairs(formatRules) do
if num >= t.num then
return string.format(t.rule, onesVal)
end
end
error('No format rule found for input ' .. tostring(num))
end
return p
ff61251a55bb4f9937367f9b5712e2eea8edb826
模块:For
828
650
1822
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
local mArguments --initialize lazily
local mHatlist = require('Module:Hatnote list')
local mHatnote = require('Module:Hatnote')
local yesNo = require('Module:Yesno')
local p = {}
--Implements {{For}} from the frame
--uses capitalized "For" to avoid collision with Lua reserved word "for"
function p.For (frame)
mArguments = require('Module:Arguments')
return p._For(mArguments.getArgs(frame))
end
--Implements {{For}} but takes a manual arguments table
function p._For (args)
local use = args[1]
if (not use) then
return mHatnote.makeWikitextError(
'no context parameter provided. Use {{other uses}} for "other uses" hatnotes.',
'Template:For#Errors',
args.category
)
end
local pages = {}
function two (a, b) return a, b, 1 end --lets us run ipairs from 2
for k, v in two(ipairs(args)) do table.insert(pages, v) end
local title = mw.title.getCurrentTitle()
local skipCat = title.isTalkPage or title.namespace == 2 --don't categorise talk pages and userspace
local oddCat = skipCat and '' or '[[Category:Hatnote templates using unusual parameters]]'
local category = yesNo(args.category)
return mHatnote._hatnote(
mHatlist.forSeeTableToString({{use = use, pages = pages}}),
{
selfref = args.selfref,
icon = 'WikimediaUI-ArticleDisambiguation-ltr.svg'
}
) .. (
(use == 'other uses') and ((category == true) or (category == nil)) and
oddCat or ''
)
end
return p
6611b3daa5b700280f9d0ecc065ad08f0ba6500b
模块:Pagetype
828
651
1823
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
if redirect then
return redirect
else
return getNsDetectValue(args)
end
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
4e76ed8318e724693304c0ca2063b36b0890825a
模块:Namespace detect
828
652
1824
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
模块:Labelled list hatnote
828
653
1825
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Labelled list --
-- --
-- This module does the core work of creating a hatnote composed of a list --
-- prefixed by a colon-terminated label, i.e. "LABEL: [andList of pages]", --
-- for {{see also}} and similar templates. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local p = {}
-- Defaults global to this module
local defaults = {
label = 'See also', --Final fallback for label argument
labelForm = '%s: %s',
prefixes = {'label', 'label ', 'l'},
template = 'Module:Labelled list hatnote'
}
-- Helper function that pre-combines display parameters into page arguments.
-- Also compresses sparse arrays, as a desirable side-effect.
function p.preprocessDisplays (args, prefixes)
-- Prefixes specify which parameters, in order, to check for display options
-- They each have numbers auto-appended, e.g. 'label1', 'label 1', & 'l1'
prefixes = prefixes or defaults.prefixes
local pages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local display
for i = 1, #prefixes do
display = args[prefixes[i] .. k]
if display then break end
end
local page = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
pages[#pages + 1] = page
end
end
return pages
end
-- Produces a labelled pages-list hatnote.
-- The main frame (template definition) takes 1 or 2 arguments, for a singular
-- and (optionally) plural label respectively:
-- * {{#invoke:Labelled list hatnote|labelledList|Singular label|Plural label}}
-- The resulting template takes pagename & label parameters normally.
function p.labelledList (frame)
mArguments = require('Module:Arguments')
local labels = {frame.args[1] or defaults.label}
labels[2] = frame.args[2] or labels[1]
local template = frame:getParent():getTitle()
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = p.preprocessDisplays(args)
local options = {
extraclasses = frame.args.extraclasses,
category = args.category,
selfref = frame.args.selfref or args.selfref,
template = template
}
return p._labelledList(pages, labels, options)
end
function p._labelledList (pages, labels, options)
labels = labels or {}
if #pages == 0 then
return mHatnote.makeWikitextError(
'no page names specified',
(options.template or defaults.template) .. '#Errors',
options.category
)
end
label = (#pages == 1 and labels[1] or labels[2]) or defaults.label
local text = string.format(
options.labelForm or defaults.labelForm,
label,
mHatlist.andList(pages, true)
)
local hnOptions = {
extraclasses = options.extraclasses,
selfref = options.selfref,
icon = 'WikimediaUI-ArticleDisambiguation-ltr.svg'
}
return mHatnote._hatnote(text, hnOptions)
end
return p
29c8896b912af113d687f6faf5d29908039cae56
模块:String2
828
654
1826
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
local p = {}
p.upper = function(frame)
local s = mw.text.trim(frame.args[1] or "")
return string.upper(s)
end
p.lower = function(frame)
local s = mw.text.trim(frame.args[1] or "")
return string.lower(s)
end
p.sentence = function (frame )
frame.args[1] = string.lower(frame.args[1])
return p.ucfirst(frame)
end
p.ucfirst = function (frame )
local s = mw.text.trim( frame.args[1] or "" )
local s1 = ""
-- if it's a list chop off and (store as s1) everything up to the first <li>
local lipos = string.find(s, "<li>" )
if lipos then
s1 = string.sub(s, 1, lipos + 3)
s = string.sub(s, lipos + 4)
end
-- s1 is either "" or the first part of the list markup, so we can continue
-- and prepend s1 to the returned string
if string.find(s, "^%[%[[^|]+|[^%]]+%]%]") then
-- this is a piped wikilink, so we capitalise the text, not the pipe
local b, c = string.find(s, "|%A*%a") -- find the first letter after the pipe
return s1 .. string.sub(s, 1, c-1) .. string.upper(string.sub(s, c, c)) .. string.sub(s, c+1)
end
local letterpos = string.find(s, '%a')
if letterpos then
local first = string.sub(s, 1, letterpos - 1)
local letter = string.sub(s, letterpos, letterpos)
local rest = string.sub(s, letterpos + 1)
return s1 .. first .. string.upper(letter) .. rest
else
return s1 .. s
end
end
p.title = function (frame )
-- http://grammar.yourdictionary.com/capitalization/rules-for-capitalization-in-titles.html
-- recommended by The U.S. Government Printing Office Style Manual:
-- "Capitalize all words in titles of publications and documents,
-- except a, an, the, at, by, for, in, of, on, to, up, and, as, but, or, and nor."
local alwayslower = {['a'] = 1, ['an'] = 1, ['the'] = 1,
['and'] = 1, ['but'] = 1, ['or'] = 1, ['for'] = 1,
['nor'] = 1, ['on'] = 1, ['in'] = 1, ['at'] = 1, ['to'] = 1,
['from'] = 1, ['by'] = 1, ['of'] = 1, ['up'] = 1 }
local res = ''
local s = mw.text.trim( frame.args[1] or "" )
local words = mw.text.split( s, " ")
for i, s in ipairs(words) do
s = string.lower( s )
if( i > 1 and alwayslower[s] == 1) then
-- leave in lowercase
else
s = mw.getContentLanguage():ucfirst(s)
end
words[i] = s
end
return table.concat(words, " ")
end
-- stripZeros finds the first number and strips leading zeros (apart from units)
-- e.g "0940" -> "940"; "Year: 0023" -> "Year: 23"; "00.12" -> "0.12"
p.stripZeros = function(frame)
local s = mw.text.trim(frame.args[1] or "")
n = tonumber( string.match( s, "%d+" ) ) or ""
s = string.gsub( s, "%d+", n, 1 )
return s
end
-- nowiki ensures that a string of text is treated by the MediaWiki software as just a string
-- it takes an unnamed parameter and trims whitespace, then removes any wikicode
p.nowiki = function(frame)
local str = mw.text.trim(frame.args[1] or "")
return mw.text.nowiki(str)
end
-- posnq (position, no quotes) returns the numerical start position of the first occurrence
-- of one piece of text ("match") inside another ("str").
-- It returns nil if no match is found, or if either parameter is blank.
-- It takes the text to be searched in as the first unnamed parameter, which is trimmed.
-- It takes the text to match as the second unnamed parameter, which is trimmed and
-- any double quotes " are stripped out.
p.posnq = function(frame)
local str = mw.text.trim(frame.args[1] or "")
local match = mw.text.trim(frame.args[2] or ""):gsub('"', '')
if str == "" or match == "" then return nil end
-- just take the start position
local pos = str:find(match, 1, true)
return pos
end
return p
5b2b222a446537544c7ac63525e99c0abaf5196b
模块:Parameter names example
828
655
1827
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
391f002bab27f87b76adcc1e33439496d080e6ab
模块:Time ago
828
656
1828
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
-- Replacement for [[Template:Time ago]]
local numberSpell = require('Module:NumberSpell')._main
local yesno = require('Module:Yesno')
local p = {}
-- Table to convert entered text values to numeric values.
timeText = {
['seconds'] = 1,
['minutes'] = 60,
['hours'] = 3600,
['days'] = 86400,
['weeks'] = 604800,
['months'] = 2678400,
['years'] = 31557600
}
-- Table containing tables of possible units to use in output.
timeUnits = {
[1] = { 'second', 'seconds', "second's", "seconds'" },
[60] = { 'minute', 'minutes', "minutes'", "minutes'" },
[3600] = { 'hour', 'hours', "hour's", "hours'" },
[86400] = { 'day', 'days', "day's", "days'" },
[604800] = { 'week', 'weeks', "week's", "weeks'" },
[2678400] = { 'month', 'months', "month's", "months'" },
[31557600] = { 'year', 'years', "year's", "years'" }
}
function p._main( args )
-- Initialize variables
local lang = mw.language.getContentLanguage()
local auto_magnitude_num
local min_magnitude_num
local result
local result_unit
local magnitude = args.magnitude
local min_magnitude = args.min_magnitude
local purge = args.purge
local spell_out = args.spellout
local spell_out_max = args.spelloutmax
-- Add a purge link if something (usually "yes") is entered into the purge parameter
if purge then
purge = ' <span class="plainlinks">([' .. mw.title.getCurrentTitle():fullUrl('action=purge') .. ' purge])</span>'
else
purge = ''
end
-- Check that the entered timestamp is valid. If it isn't, then give an error message.
local noError, inputTime = pcall( lang.formatDate, lang, 'U', args[1], true )
if not noError then
return '<strong class="error">Error: first parameter cannot be parsed as a date or time.</strong>'
end
-- Store the difference between the current time and the inputted time, as well as its absolute value.
local timeDiff = lang:formatDate( 'U', nil, true ) - inputTime
local absTimeDiff = math.abs( timeDiff )
if magnitude then
auto_magnitude_num = 0
min_magnitude_num = timeText[magnitude]
else
-- Calculate the appropriate unit of time if it was not specified as an argument.
local autoMagnitudeData = {
{ denom = 63115200, amn = 31557600 },
{ denom = 5356800, amn = 2678400 },
{ denom = 172800, amn = 86400 },
{ denom = 7200, amn = 3600 },
{ denom = 120, amn = 60 }
}
for i, t in ipairs( autoMagnitudeData ) do
if absTimeDiff / t.denom >= 1 then
auto_magnitude_num = t.amn
break
end
end
auto_magnitude_num = auto_magnitude_num or 1
if min_magnitude then
min_magnitude_num = timeText[min_magnitude]
else
min_magnitude_num = -1
end
end
if not min_magnitude_num then
-- Default to seconds if an invalid magnitude is entered.
min_magnitude_num = 1
end
local magnitude_num = math.max( min_magnitude_num, auto_magnitude_num )
local result_num = math.floor ( absTimeDiff / magnitude_num )
local punctuation_key, suffix
if timeDiff >= 0 then -- Past
if result_num == 1 then
punctuation_key = 1
else
punctuation_key = 2
end
if args.ago == '' then
suffix = ''
else
suffix = ' ' .. (args.ago or 'ago')
end
else -- Future
if args.ago == '' then
suffix = ''
if result_num == 1 then
punctuation_key = 1
else
punctuation_key = 2
end
else
suffix = ' time'
if result_num == 1 then
punctuation_key = 3
else
punctuation_key = 4
end
end
end
result_unit = timeUnits[ magnitude_num ][ punctuation_key ]
-- Convert numerals to words if appropriate.
spell_out_max = tonumber( spell_out_max ) -- Would cause script errors if not a number.
local result_num_text
if ( spell_out == 'auto' and 1 <= result_num and result_num <= 9 and result_num <= ( spell_out_max or 9 ) )
or ( yesno( spell_out ) and 1 <= result_num and result_num <= 100 and result_num <= ( spell_out_max or 100 ) )
then
result_num_text = numberSpell( result_num )
else
result_num_text = tostring( result_num )
end
result = result_num_text .. ' ' .. result_unit .. suffix -- Spaces for suffix have been added in earlier.
return result .. purge
end
function p.main( frame )
local args = require( 'Module:Arguments' ).getArgs( frame, {
valueFunc = function( k, v )
if v then
v = v:match( '^%s*(.-)%s*$' ) -- Trim whitespace.
if k == 'ago' or v ~= '' then
return v
end
end
return nil
end,
wrappers = 'Template:Time ago'
})
return p._main( args )
end
return p
6f893788f6393bfeb0e0776ef2789343087269ce
模块:Ordinal
828
657
1829
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--[[
This template will add the appropriate ordinal suffix to a given integer.
Please do not modify this code without applying the changes first at
Module:Ordinal/sandbox and testing.
]]
local p = {}
local yesno = require('Module:Yesno') -- boolean value interpretation
--[[
This function converts an integer value into a numeral followed by ordinal indicator.
The output string might contain HTML tags.
Usage:
{{#invoke:Ordinal|ordinal|1=|2=|sup=}}
{{#invoke:Ordinal|ordinal}} - uses the caller's parameters
Parameters
1: Any number or string.
2: Set to "d" if the module should display "d" instead of "nd" and "rd".
sup: Set to yes/no to toggle superscript ordinal suffix.
]]
function p.ordinal(frame)
local args = frame.args
if args[1] == nil then
args = frame:getParent().args
end
if args[1] == nil then
args[1] = "{{{1}}}"
end
return p._ordinal(args[1], (args[2] == 'd'), yesno(args.sup))
end
function p._ordinal(n, d, sup)
local x = tonumber(mw.ustring.match(n, "(%d*)%W*$"))
local suffix = "th"
-- If tonumber(n) worked:
if x then
local mod10 = math.abs(x) % 10
local mod100 = math.abs(x) % 100
if mod10 == 1 and mod100 ~= 11 then
suffix = "st"
elseif mod10 == 2 and mod100 ~= 12 then
if d then suffix = "d" else suffix = "nd" end
elseif mod10 == 3 and mod100 ~= 13 then
if d then suffix = "d" else suffix = "rd" end
end
end
if sup then
suffix = "<sup>" .. suffix .. "</sup>"
end
return n .. suffix
end
return p
5e0250f8a204092c43bb598a1e9814f97ebe823e
模块:Transcluder
828
659
1831
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
local p = {}
-- Helper function to test for truthy and falsy values
local function truthy(value)
if not value or value == '' or value == 0 or value == '0' or value == 'false' or value == 'no' then
return false
end
return true
end
-- Helper function to match from a list regular expressions
-- Like so: match pre..list[1]..post or pre..list[2]..post or ...
local function matchAny(text, pre, list, post, init)
local match = {}
for i = 1, #list do
match = { mw.ustring.match(text, pre .. list[i] .. post, init) }
if match[1] then return unpack(match) end
end
return nil
end
local function escapeString(str)
return mw.ustring.gsub(str, '[%^%$%(%)%.%[%]%*%+%-%?%%]', '%%%0')
end
-- Helper function to remove a string from a text
local function removeString(text, str)
local pattern = escapeString(str)
if #pattern > 9999 then -- strings longer than 10000 bytes can't be put into regexes
pattern = escapeString(mw.ustring.sub(str, 1, 999)) .. '.-' .. escapeString(mw.ustring.sub(str, -999))
end
return mw.ustring.gsub(text, pattern, '')
end
-- Helper function to convert a comma-separated list of numbers or min-max ranges into a list of booleans
-- @param flags Comma-separated list of numbers or min-max ranges, for example '1,3-5'
-- @return Map from integers to booleans, for example {1=true,2=false,3=true,4=true,5=true}
-- @return Boolean indicating wether the flags should be treated as a blacklist or not
local function parseFlags(value)
local flags = {}
local blacklist = false
if not value then return nil, false end
if type(value) == 'number' then
if value < 0 then
value = value * -1
blacklist = true
end
flags = { [value] = true }
elseif type(value) == 'string' then
if mw.ustring.sub(value, 1, 1) == '-' then
blacklist = true
value = mw.ustring.sub(value, 2)
end
local ranges = mw.text.split(value, ',') -- split ranges: '1,3-5' to {'1','3-5'}
for _, range in pairs(ranges) do
range = mw.text.trim(range)
local min, max = mw.ustring.match(range, '^(%d+)%s*%-%s*(%d+)$') -- '3-5' to min=3 max=5
if not max then min, max = mw.ustring.match(range, '^((%d+))$') end -- '1' to min=1 max=1
if max then
for p = min, max do flags[p] = true end
else
flags[range] = true -- if we reach this point, the string had the form 'a,b,c' rather than '1,2,3'
end
end
-- List has the form { [1] = false, [2] = true, ['c'] = false }
-- Convert it to { [1] = true, [2] = true, ['c'] = true }
-- But if ANY value is set to false, treat the list as a blacklist
elseif type(value) == 'table' then
for i, v in pairs(value) do
if v == false then blacklist = true end
flags[i] = true
end
end
return flags, blacklist
end
-- Helper function to see if a value matches any of the given flags
local function matchFlag(value, flags)
if not value then return false end
value = tostring(value)
local lang = mw.language.getContentLanguage()
for flag in pairs(flags) do
if value == tostring(flag)
or lang:lcfirst(value) == flag
or lang:ucfirst(value) == flag
or ( not tonumber(flag) and mw.ustring.match(value, flag) ) then
return true
end
end
end
-- Helper function to convert template arguments into an array of options fit for get()
local function parseArgs(frame)
local args = {}
for key, value in pairs(frame:getParent().args) do args[key] = value end
for key, value in pairs(frame.args) do args[key] = value end -- args from Lua calls have priority over parent args from template
return args
end
-- Error handling function
-- Throws a Lua error or returns an empty string if error reporting is disabled
local function throwError(key, value)
local TNT = require('Module:TNT')
local ok, message = pcall(TNT.format, 'I18n/Module:Transcluder.tab', 'error-' .. key, value)
if not ok then message = key end
error(message, 2)
end
-- Error handling function
-- Returns a wiki friendly error or an empty string if error reporting is disabled
local function getError(key, value)
local TNT = require('Module:TNT')
local ok, message = pcall(TNT.format, 'I18n/Module:Transcluder.tab', 'error-' .. key, value)
if not ok then message = key end
message = mw.html.create('div'):addClass('error'):wikitext(message)
return message
end
-- Helper function to get the local name of a namespace and all its aliases
-- @param name Canonical name of the namespace, for example 'File'
-- @return Local name of the namespace and all aliases, for example {'File','Image','Archivo','Imagen'}
local function getNamespaces(name)
local namespaces = mw.site.namespaces[name].aliases
table.insert(namespaces, mw.site.namespaces[name].name)
table.insert(namespaces, mw.site.namespaces[name].canonicalName)
return namespaces
end
-- Get the page wikitext, following redirects
-- Also returns the page name, or the target page name if a redirect was followed, or false if no page was found
-- For file pages, returns the content of the file description page
local function getText(page, noFollow)
local title = mw.title.new(page)
if not title then return false, false end
local target = title.redirectTarget
if target and not noFollow then title = target end
local text = title:getContent()
if not text then return false, title.prefixedText end
-- Remove <noinclude> tags
text = mw.ustring.gsub(text, '<[Nn][Oo][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>.-</[Nn][Oo][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>', '') -- remove noinclude bits
-- Keep <onlyinclude> tags
if mw.ustring.find(text, '[Oo][Nn][Ll][Yy][Ii][Nn][Cc][Ll][Uu][Dd][Ee]') then -- avoid expensive search if possible
text = mw.ustring.gsub(text, '</[Oo][Nn][Ll][Yy][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>.-<[Oo][Nn][Ll][Yy][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>', '') -- remove text between onlyinclude sections
text = mw.ustring.gsub(text, '^.-<[Oo][Nn][Ll][Yy][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>', '') -- remove text before first onlyinclude section
text = mw.ustring.gsub(text, '</[Oo][Nn][Ll][Yy][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>.*', '') -- remove text after last onlyinclude section
end
return text, title.prefixedText
end
-- Get the requested files out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of files to return, for example 2 or '1,3-5'. Omit to return all files.
-- @return Sequence of strings containing the wikitext of the requested files.
-- @return Original wikitext minus requested files.
local function getFiles(text, flags)
local files = {}
local flags, blacklist = parseFlags(flags)
local fileNamespaces = getNamespaces('File')
local name
local count = 0
for file in mw.ustring.gmatch(text, '%b[]') do
if matchAny(file, '%[%[%s*', fileNamespaces, '%s*:.*%]%]') then
name = mw.ustring.match(file, '%[%[[^:]-:([^]|]+)')
count = count + 1
if not blacklist and ( not flags or flags[count] or matchFlag(name, flags) )
or blacklist and flags and not flags[count] and not matchFlag(name, flags) then
table.insert(files, file)
else
text = removeString(text, file)
end
end
end
return files, text
end
-- Get the requested tables out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of tables to return, for example 2 or '1,3-5'. Omit to return all tables.
-- @return Sequence of strings containing the wikitext of the requested tables.
-- @return Original wikitext minus requested tables.
local function getTables(text, flags)
local tables = {}
local flags, blacklist = parseFlags(flags)
local id
local count = 0
for t in mw.ustring.gmatch('\n' .. text, '\n%b{}') do
if mw.ustring.sub(t, 1, 3) == '\n{|' then
id = mw.ustring.match(t, '\n{|[^\n]-id%s*=%s*["\']?([^"\'\n]+)["\']?[^\n]*\n')
count = count + 1
if not blacklist and ( not flags or flags[count] or flags[id] )
or blacklist and flags and not flags[count] and not flags[id] then
table.insert(tables, t)
else
text = removeString(text, t)
end
end
end
return tables, text
end
-- Get the requested templates out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of templates to return, for example 2 or '1,3-5'. Omit to return all templates.
-- @return Sequence of strings containing the wikitext of the requested templates.
-- @return Original wikitext minus requested templates.
local function getTemplates(text, flags)
local templates = {}
local flags, blacklist = parseFlags(flags)
local name
local count = 0
for template in mw.ustring.gmatch(text, '{%b{}}') do
if mw.ustring.sub(template, 1, 3) ~= '{{#' then -- skip parser functions like #if
name = mw.text.trim( mw.ustring.match(template, '{{([^}|\n]+)') ) -- get the template name
count = count + 1
if not blacklist and ( not flags or flags[count] or matchFlag(name, flags) )
or blacklist and flags and not flags[count] and not matchFlag(name, flags) then
table.insert(templates, template)
else
text = removeString(text, template)
end
end
end
return templates, text
end
-- Get the requested template parameters out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of parameters to return, for example 2 or '1,3-5'. Omit to return all parameters.
-- @return Map from parameter name to value, NOT IN THE ORIGINAL ORDER
-- @return Original wikitext minus requested parameters.
local function getParameters(text, flags)
local parameters = {}
local flags, blacklist = parseFlags(flags)
local params, count, parts, key, value
for template in mw.ustring.gmatch(text, '{%b{}}') do
params = mw.ustring.match(template, '{{[^|}]-|(.+)}}')
if params then
count = 0
-- Temporarily replace pipes in subtemplates, tables and links to avoid chaos
for subtemplate in mw.ustring.gmatch(params, '%b{}') do
params = mw.ustring.gsub(params, escapeString(subtemplate), mw.ustring.gsub(mw.ustring.gsub(subtemplate, '%%', '%%%'), '|', '@@@') )
end
for link in mw.ustring.gmatch(params, '%b[]') do
params = mw.ustring.gsub(params, escapeString(link), mw.ustring.gsub(link, '|', '@@@') )
end
for parameter in mw.text.gsplit(params, '|') do
parts = mw.text.split(parameter, '=')
key = mw.text.trim(parts[1])
value = table.concat(parts, '=', 2)
if value == '' then
value = key
count = count + 1
key = count
else
value = mw.text.trim(value)
end
value = mw.ustring.gsub(value, '@@@', '|')
if not blacklist and ( not flags or matchFlag(key, flags) )
or blacklist and flags and not matchFlag(key, flags) then
parameters[key] = value
else
text = removeString(text, parameter)
end
end
end
end
return parameters, text
end
-- Get the requested lists out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of lists to return, for example 2 or '1,3-5'. Omit to return all lists.
-- @return Sequence of strings containing the wikitext of the requested lists.
-- @return Original wikitext minus requested lists.
local function getLists(text, flags)
local lists = {}
local flags, blacklist = parseFlags(flags)
local count = 0
for list in mw.ustring.gmatch('\n' .. text .. '\n\n', '\n([*#].-)\n[^*#]') do
count = count + 1
if not blacklist and ( not flags or flags[count] )
or blacklist and flags and not flags[count] then
table.insert(lists, list)
else
text = removeString(text, list)
end
end
return lists, text
end
-- Get the requested paragraphs out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of paragraphs to return, for example 2 or '1,3-5'. Omit to return all paragraphs.
-- @return Sequence of strings containing the wikitext of the requested paragraphs.
-- @return Original wikitext minus requested paragraphs.
local function getParagraphs(text, flags)
local paragraphs = {}
local flags, blacklist = parseFlags(flags)
-- Remove non-paragraphs
local elements
local temp = '\n' .. text .. '\n'
elements, temp = getLists(temp, 0) -- remove lists
elements, temp = getFiles(temp, 0) -- remove files
temp = mw.ustring.gsub(temp, '\n%b{}\n', '\n%0\n') -- add spacing between tables and block templates
temp = mw.ustring.gsub(temp, '\n%b{}\n', '\n') -- remove tables and block templates
temp = mw.ustring.gsub(temp, '\n==+[^=]+==+\n', '\n') -- remove section titles
temp = mw.text.trim(temp)
-- Assume that anything remaining is a paragraph
local count = 0
for paragraph in mw.text.gsplit(temp, '\n\n+') do
if mw.text.trim(paragraph) ~= '' then
count = count + 1
if not blacklist and ( not flags or flags[count] )
or blacklist and flags and not flags[count] then
table.insert(paragraphs, paragraph)
else
text = removeString(text, paragraph)
end
end
end
return paragraphs, text
end
-- Get the requested categories out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of categories to return, for example 2 or '1,3-5'. Omit to return all categories.
-- @return Sequence of strings containing the wikitext of the requested categories.
-- @return Original wikitext minus requested categories.
local function getCategories(text, flags)
local categories = {}
local flags, blacklist = parseFlags(flags)
local categoryNamespaces = getNamespaces('Category')
local name
local count = 0
for category in mw.ustring.gmatch(text, '%b[]') do
if matchAny(category, '%[%[%s*', categoryNamespaces, '%s*:.*%]%]') then
name = mw.ustring.match(category, '%[%[[^:]-:([^]|]+)')
count = count + 1
if not blacklist and ( not flags or flags[count] or matchFlag(name, flags) )
or blacklist and flags and not flags[count] and not matchFlag(name, flags) then
table.insert(categories, category)
else
text = removeString(text, category)
end
end
end
return categories, text
end
-- Get the requested references out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @param flags Range of references to return, for example 2 or '1,3-5'. Omit to return all references.
-- @return Sequence of strings containing the wikitext of the requested references.
-- @return Original wikitext minus requested references.
local function getReferences(text, flags)
local references = {}
local flags, blacklist = parseFlags(flags)
local name
local count = 0
for reference in mw.ustring.gmatch(text, '<%s*[Rr][Ee][Ff][^>/]*>.-<%s*/%s*[Rr][Ee][Ff]%s*>') do
name = mw.ustring.match(reference, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?([^"\'>/]+)["\']?[^>]*%s*>')
count = count + 1
if not blacklist and ( not flags or flags[count] or matchFlag(name, flags) )
or blacklist and flags and not flags[count] and not matchFlag(name, flags) then
table.insert(references, reference)
else
text = removeString(text, reference)
if name then
for citation in mw.ustring.gmatch(text, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?' .. escapeString(name) .. '["\']?[^/>]*/%s*>') do
text = removeString(text, citation)
end
end
end
end
return references, text
end
-- Get the lead section out of the given wikitext.
-- @param text Required. Wikitext to parse.
-- @return Wikitext of the lead section.
local function getLead(text)
text = mw.ustring.gsub('\n' .. text, '\n==.*', '')
text = mw.text.trim(text)
if not text then return throwError('lead-empty') end
return text
end
-- Get the wikitext of the requested sections
-- @param text Required. Wikitext to parse.
-- @param flags Range of sections to return, for example 2 or '1,3-5'. Omit to return all references.
-- @return Sequence of strings containing the wikitext of the requested sections.
-- @return Original wikitext minus requested sections.
local function getSections(text, flags)
local sections = {}
local flags, blacklist = parseFlags(flags)
local count = 0
local prefix, section, suffix
for title in mw.ustring.gmatch('\n' .. text .. '\n==', '\n==+%s*([^=]+)%s*==+\n') do
count = count + 1
prefix, section, suffix = mw.ustring.match('\n' .. text .. '\n==', '\n()==+%s*' .. escapeString(title) .. '%s*==+(.-)()\n==')
if not blacklist and ( not flags or flags[count] or matchFlag(title, flags) )
or blacklist and flags and not flags[count] and not matchFlag(title, flags) then
sections[title] = section
else
text = mw.ustring.sub(text, 1, prefix) .. mw.ustring.sub(text, suffix)
text = mw.ustring.gsub(text, '\n?==$', '') -- remove the trailing \n==
end
end
return sections, text
end
-- Get the requested section out of the given wikitext (including subsections).
-- @param text Required. Wikitext to parse.
-- @param section Required. Title of the section to get (in wikitext), for example 'History' or 'History of [[Athens]]'.
-- @return Wikitext of the requested section.
local function getSection(text, section)
section = mw.text.trim(section)
local escapedSection = escapeString(section)
-- First check if the section title matches a <section> tag
if mw.ustring.find(text, '<%s*[Ss]ection%s+begin%s*=%s*["\']?%s*' .. escapedSection .. '%s*["\']?%s*/>') then -- avoid expensive search if possible
text = mw.ustring.gsub(text, '<%s*[Ss]ection%s+end=%s*["\']?%s*'.. escapedSection ..'%s*["\']?%s*/>.-<%s*[Ss]ection%s+begin%s*=%s*["\']?%s*' .. escapedSection .. '%s*["\']?%s*/>', '') -- remove text between section tags
text = mw.ustring.gsub(text, '^.-<%s*[Ss]ection%s+begin%s*=%s*["\']?%s*' .. escapedSection .. '%s*["\']?%s*/>', '') -- remove text before first section tag
text = mw.ustring.gsub(text, '<%s*[Ss]ection%s+end=%s*["\']?%s*'.. escapedSection ..'%s*["\']?%s*/>.*', '') -- remove text after last section tag
text = mw.text.trim(text)
if text == '' then return throwError('section-tag-empty', section) end
return text
end
local level, text = mw.ustring.match('\n' .. text .. '\n', '\n(==+)%s*' .. escapedSection .. '%s*==.-\n(.*)')
if not text then return throwError('section-not-found', section) end
local nextSection = '\n==' .. mw.ustring.rep('=?', #level - 2) .. '[^=].*'
text = mw.ustring.gsub(text, nextSection, '') -- remove later sections with headings at this level or higher
text = mw.text.trim(text)
if text == '' then return throwError('section-empty', section) end
return text
end
-- Replace the first call to each reference defined outside of the text for the full reference, to prevent undefined references
-- Then prefix the page title to the reference names to prevent conflicts
-- that is, replace <ref name="Foo"> for <ref name="Title of the article Foo">
-- and also <ref name="Foo" /> for <ref name="Title of the article Foo" />
-- also remove reference groups: <ref name="Foo" group="Bar"> for <ref name="Title of the article Foo">
-- and <ref group="Bar"> for <ref>
-- @todo The current regex may fail in cases with both kinds of quotes, like <ref name="Darwin's book">
local function fixReferences(text, page, full)
if not full then full = getText(page) end
local refNames = {}
local refName
local refBody
local position = 1
while position < mw.ustring.len(text) do
refName, position = mw.ustring.match(text, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?([^"\'>]+)["\']?[^>]*/%s*>()', position)
if refName then
refName = mw.text.trim(refName)
if not refNames[refName] then -- make sure we process each ref name only once
table.insert(refNames, refName)
refName = escapeString(refName)
refBody = mw.ustring.match(text, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?%s*' .. refName .. '%s*["\']?[^>/]*>.-<%s*/%s*[Rr][Ee][Ff]%s*>')
if not refBody then -- the ref body is not in the excerpt
refBody = mw.ustring.match(full, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?%s*' .. refName .. '%s*["\']?[^/>]*>.-<%s*/%s*[Rr][Ee][Ff]%s*>')
if refBody then -- the ref body was found elsewhere
text = mw.ustring.gsub(text, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?%s*' .. refName .. '%s*["\']?[^>]*/?%s*>', mw.ustring.gsub(refBody, '%%', '%%%%'), 1)
end
end
end
else
position = mw.ustring.len(text)
end
end
text = mw.ustring.gsub(text, '<%s*[Rr][Ee][Ff][^>]*name%s*=%s*["\']?([^"\'>/]+)["\']?[^>/]*(/?)%s*>', '<ref name="' .. page .. ' %1"%2>')
text = mw.ustring.gsub(text, '<%s*[Rr][Ee][Ff]%s*group%s*=%s*["\']?[^"\'>/]+["\']%s*>', '<ref>')
return text
end
-- Replace the bold title or synonym near the start of the page by a link to the page
function linkBold(text, page)
local lang = mw.language.getContentLanguage()
local position = mw.ustring.find(text, "'''" .. lang:ucfirst(page) .. "'''", 1, true) -- look for "'''Foo''' is..." (uc) or "A '''foo''' is..." (lc)
or mw.ustring.find(text, "'''" .. lang:lcfirst(page) .. "'''", 1, true) -- plain search: special characters in page represent themselves
if position then
local length = mw.ustring.len(page)
text = mw.ustring.sub(text, 1, position + 2) .. "[[" .. mw.ustring.sub(text, position + 3, position + length + 2) .. "]]" .. mw.ustring.sub(text, position + length + 3, -1) -- link it
else -- look for anything unlinked in bold, assumed to be a synonym of the title (e.g. a person's birth name)
text = mw.ustring.gsub(text, "()'''(.-'*)'''", function(a, b)
if not mw.ustring.find(b, "%[") and not mw.ustring.find(b, "%{") then -- if not wikilinked or some weird template
return "'''[[" .. page .. "|" .. b .. "]]'''" -- replace '''Foo''' by '''[[page|Foo]]'''
else
return nil -- instruct gsub to make no change
end
end, 1) -- "end" here terminates the anonymous replacement function(a, b) passed to gsub
end
return text
end
-- Remove non-free files.
-- @param text Required. Wikitext to clean.
-- @return Clean wikitext.
local function removeNonFreeFiles(text)
local fileNamespaces = getNamespaces('File')
local fileName
local fileDescription
local frame = mw.getCurrentFrame()
for file in mw.ustring.gmatch(text, '%b[]') do
if matchAny(file, '%[%[%s*', fileNamespaces, '%s*:.*%]%]') then
fileName = 'File:' .. mw.ustring.match(file, '%[%[[^:]-:([^]|]+)')
fileDescription, fileName = getText(fileName)
if fileName then
if not fileDescription or fileDescription == '' then
fileDescription = frame:preprocess('{{' .. fileName .. '}}') -- try Commons
end
if fileDescription and mw.ustring.match(fileDescription, '[Nn]on%-free') then
text = removeString(text, file)
end
end
end
end
return text
end
-- Remove any self links
function removeSelfLinks(text)
local lang = mw.language.getContentLanguage()
local page = escapeString( mw.title.getCurrentTitle().prefixedText )
text = mw.ustring.gsub(text, '%[%[(' .. lang:ucfirst(page) .. ')%]%]', '%1')
text = mw.ustring.gsub(text, '%[%[(' .. lang:lcfirst(page) .. ')%]%]', '%1')
text = mw.ustring.gsub(text, '%[%[' .. lang:ucfirst(page) .. '|([^]]+)%]%]', '%1')
text = mw.ustring.gsub(text, '%[%[' .. lang:lcfirst(page) .. '|([^]]+)%]%]', '%1')
return text
end
-- Remove all wikilinks
function removeLinks(text)
text = mw.ustring.gsub(text, '%[%[[^|]+|([^]]+)%]%]', '%1')
text = mw.ustring.gsub(text, '%[%[([^]]+)%]%]', '%1')
return text
end
-- Remove HTML comments
function removeComments(text)
text = mw.ustring.gsub(text, '<!%-%-.-%-%->', '')
return text
end
-- Remove behavior switches, such as __NOTOC__
function removeBehaviorSwitches(text)
text = mw.ustring.gsub(text, '__[A-Z]+__', '')
return text
end
-- Remove bold text
function removeBold(text)
text = mw.ustring.gsub(text, "'''", '')
return text
end
-- Main function for modules
local function get(page, options)
if not options then options = {} end
if not page then return throwError('no-page') end
page = mw.text.trim(page)
if page == '' then return throwError('no-page') end
local page, hash, section = mw.ustring.match(page, '([^#]+)(#?)([^#]*)')
local text, page = getText(page, options.noFollow)
if not page then return throwError('no-page') end
if not text then return throwError('page-not-found', page) end
local full = text -- save the full text for fixReferences below
-- Get the requested section
if truthy(section) then
text = getSection(text, section)
elseif truthy(hash) then
text = getLead(text)
end
-- Keep only the requested elements
local elements
if options.only then
if options.only == 'sections' then elements = getSections(text, options.sections) end
if options.only == 'lists' then elements = getLists(text, options.lists) end
if options.only == 'files' then elements = getFiles(text, options.files) end
if options.only == 'tables' then elements = getTables(text, options.tables) end
if options.only == 'templates' then elements = getTemplates(text, options.templates) end
if options.only == 'parameters' then elements = getParameters(text, options.parameters) end
if options.only == 'paragraphs' then elements = getParagraphs(text, options.paragraphs) end
if options.only == 'categories' then elements = getCategories(text, options.categories) end
if options.only == 'references' then elements = getReferences(text, options.references) end
text = ''
if elements then
for key, element in pairs(elements) do
text = text .. '\n' .. element .. '\n'
end
end
end
-- Filter the requested elements
if options.sections and options.only ~= 'sections' then elements, text = getSections(text, options.sections) end
if options.lists and options.only ~= 'lists' then elements, text = getLists(text, options.lists) end
if options.files and options.only ~= 'files' then elements, text = getFiles(text, options.files) end
if options.tables and options.only ~= 'tables' then elements, text = getTables(text, options.tables) end
if options.templates and options.only ~= 'templates' then elements, text = getTemplates(text, options.templates) end
if options.parameters and options.only ~= 'parameters' then elements, text = getParameters(text, options.parameters) end
if options.paragraphs and options.only ~= 'paragraphs' then elements, text = getParagraphs(text, options.paragraphs) end
if options.categories and options.only ~= 'categories' then elements, text = getCategories(text, options.categories) end
if options.references and options.only ~= 'references' then elements, text = getReferences(text, options.references) end
-- Misc options
if truthy(options.fixReferences) then text = fixReferences(text, page, full) end
if truthy(options.linkBold) then text = linkBold(text, page) end
if truthy(options.noBold) then text = removeBold(text) end
if truthy(options.noLinks) then text = removeLinks(text) end
if truthy(options.noSelfLinks) then text = removeSelfLinks(text) end
if truthy(options.noNonFreeFiles) then text = removeNonFreeFiles(text) end
if truthy(options.noBehaviorSwitches) then text = removeBehaviorSwitches(text) end
if truthy(options.noComments) then text = removeComments(text) end
-- Remove multiple newlines left over from removing elements
text = mw.ustring.gsub(text, '\n\n\n+', '\n\n')
text = mw.text.trim(text)
return text
end
-- Main invocation function for templates
local function main(frame)
local args = parseArgs(frame)
local page = args[1]
local ok, text = pcall(get, page, args)
if not ok then return getError(text) end
return frame:preprocess(text)
end
-- Entry points for templates
function p.main(frame) return main(frame) end
-- Entry points for modules
function p.get(page, options) return get(page, options) end
function p.getText(page, noFollow) return getText(page, noFollow) end
function p.getLead(text) return getLead(text) end
function p.getSection(text, section) return getSection(text, section) end
function p.getSections(text, flags) return getSections(text, flags) end
function p.getParagraphs(text, flags) return getParagraphs(text, flags) end
function p.getParameters(text, flags) return getParameters(text, flags) end
function p.getCategories(text, flags) return getCategories(text, flags) end
function p.getReferences(text, flags) return getReferences(text, flags) end
function p.getTemplates(text, flags) return getTemplates(text, flags) end
function p.getTables(text, flags) return getTables(text, flags) end
function p.getLists(text, flags) return getLists(text, flags) end
function p.getFiles(text, flags) return getFiles(text, flags) end
function p.getError(message, value) return getError(message, value) end
-- Expose handy methods
function p.truthy(value) return truthy(value) end
function p.parseArgs(frame) return parseArgs(frame) end
function p.matchAny(text, pre, list, post, init) return matchAny(text, pre, list, post, init) end
function p.matchFlag(value, flags) return matchFlag(value, flags) end
function p.getNamespaces(name) return getNamespaces(name) end
function p.removeBold(text) return removeBold(text) end
function p.removeLinks(text) return removeLinks(text) end
function p.removeSelfLinks(text) return removeSelfLinks(text) end
function p.removeNonFreeFiles(text) return removeNonFreeFiles(text) end
function p.removeBehaviorSwitches(text) return removeBehaviorSwitches(text) end
function p.removeComments(text) return removeComments(text) end
return p
6f7d9b831e8fe32dd8f878eff9e17b2bec1d7e8e
模块:TNT
828
660
1832
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
9d0d10e54abd232c806dcabccaf03e52858634a1
模板:Start date and age
10
661
1833
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly><!--
IMPLEMENTATION OF DATE
-->{{#if: {{{1|}}}<!--
-->|{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{#ifeq:{{yesno|{{{df|no}}}}}|yes<!--
-->|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}<!--
-->|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},<!--
-->}} {{{1}}}<!--
-->|{{MONTHNAME|{{{2}}}}} {{{1}}}<!--
-->}}<!--
-->|{{#ifexpr:{{{1}}}>=0|{{{1}}} CE|{{#expr:{{{1}}}*(-1)}} BCE}}<!--
-->}}<!--
--><span class="noprint">{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes||;}}<!--
-->{{#ifeq:{{yesno|{{{br|no}}}}}|yes|<br/>| }}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|(}}<!--
-->{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{time ago|{{#ifeq:{{yesno|{{{sctime|no}}}}}|yes|{{#expr:{{{1}}}-930}}|{{{1}}}}}-{{{2}}}-{{{3}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{#ifeq:{{yesno|{{{sctime|no}}}}}|yes|{{#expr:{{{1}}}-930}}|{{{1}}}}}|{{#time:n|1-{{{2}}}-1}}}}<!--
-->}}<!--
-->|{{#iferror:{{#expr:{{{1}}}}}<!--
-->|{{time ago|{{#ifeq:{{yesno|{{{sctime|no}}}}}|yes|{{#expr:{{{1}}}-930}}|{{{1}}}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{#ifeq:{{yesno|{{{sctime|no}}}}}|yes|{{#expr:{{{1}}}-930}}|{{{1}}}}}}}<!--
-->}}<!--
-->}}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|)}}</span><!--
-->|'''{{color|red|Error: first parameter is missing.}}'''<!--
-->}}<!--
IMPLEMENTATION OF microformat date classes
--><span style="display:none"> (<span class="{{#ifeq:{{yesno|{{{end|no}}}}}|yes|dtend|bday dtstart published updated}}"><!--
-->{{#if: {{{1|}}}<!--
-->|{{{1}}}<!--
-->{{#if: {{{2|}}}<!--
-->| -{{#time:m|1-{{{2}}}-1}}<!--
-->{{#if: {{{3|}}}<!--
-->| -{{padleft:{{{3}}}|2|0}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
--></span>)</span></includeonly><noinclude>
{{/doc}}
</noinclude>
adea10a3a872276888159043db01507e71d1f08e
模板:Unbulleted list
10
662
1834
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{/doc}}</noinclude>
987099539b66dee064760a7e7e510503da9e892c
模板:Spaces
10
663
1835
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<span class="nowrap">{{#iferror:{{#expr:{{{1|1}}}}}
|{{#switch:{{{1}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}
|{{#invoke:String|rep|{{#switch:{{{2}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}|{{{1|1}}}}}
}}</span><noinclude>
{{/doc}}
</noinclude>
17efb36433f45a5c4f23528902387edcf0e174f0
模板:Void
10
665
1837
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<noinclude>{{/doc}}</noinclude>
d5ed56433dbfbb026e88f205094c9ac2bc8c5591
模板:Namespace detect
10
667
1839
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#invoke:Namespace detect|main}}<noinclude>
{{/doc}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
18d72cbf219e73260420635ec3e0d7239006577d
模板:Reflist
10
668
1840
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly><templatestyles src="Template:Reflist/styles.css" /><div class="reflist <!--
-->{{#if:{{{1|}}}{{{colwidth|}}}|reflist-columns references-column-width}} <!--
-->{{#switch:{{{group|}}}|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=reflist-{{{group}}}}} <!--
-->{{#if:{{{1|}}}|{{#iferror:{{#ifexpr: {{{1|1}}} > 1 }}||{{#switch:{{{1|}}}|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" <!-- end class
-->{{#if:{{{1|}}}{{{colwidth|}}}{{{liststyle|}}}|<!-- start style
-->style="{{#if: {{{1|}}}
| {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }} |column-width: {{{1}}};}}
| {{#if: {{{colwidth|}}}|column-width: {{{colwidth}}};}}
}} <!--
-->{{#if:{{{group|}}}||{{#if:{{{liststyle|}}}|list-style-type: {{{liststyle}}};}}}}"<!--
-->}}>
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}</div></includeonly><noinclude>{{/doc}}</noinclude>
8c72278c39c689eb2078cb99fc0e3b528d344a9e
模板:Bulleted list
10
669
1841
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|bulleted}}<noinclude>
{{/doc}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
cba9cfa1d343b4536981fb04412c1ebe1de87a9b
模板:Em
10
670
1842
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<em {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</em><noinclude>
{{/doc}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b87d8e5bbc683b23bfe8838cd946eaab066c0075
模板:Clear
10
671
1843
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{/doc}}
</noinclude>
5aa45ee7f6c42af765d5d762298871908f6b0236
模板:Ordinal
10
672
1844
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#invoke:Ordinal|ordinal}}<noinclude>
{{/doc}}
</noinclude>
160cc29fc084e89494578bfd4e32cdd349866f30
模板:Efn
10
673
1845
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{#if:{{{name|}}}
|{{#tag:ref|{{{1|{{{reference|{{{content|{{{text|}}}}}}}}}}}}|name={{{name|}}}|group={{#switch: {{{group|}}}
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = {{{group|}}}
| #default = lower-alpha
}}
}}
|{{#tag:ref|{{{1|{{{reference|{{{content|{{{text|}}}}}}}}}}}}|group={{#switch: {{{group|}}}
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = {{{group|}}}
| #default = lower-alpha
}}
}}
}}</includeonly><noinclude>{{/doc}}</noinclude>
8c9801aefab328b907eca315254e141945b718b8
模板:Notelist
10
674
1846
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{reflist|{{{1|{{{colwidth|}}}}}}|refs={{{refs|{{{notes|}}}}}}|group={{#switch: {{{group|}}}
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = {{{group|}}}
| #default = lower-alpha
}}}}</includeonly><noinclude>{{/doc}}</noinclude>
96bb8d0bd69880ea0fb35733c94bce6aa9f8eb43
模板:Plain link
10
675
1847
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<!-- The {{#if:1|...}} trims any leading and trailing whitespace without breaking <nowiki> like {{#sub:...}} does: -->
<onlyinclude><span class="plainlinks">[{{<includeonly>safesubst:</includeonly>#if:1|{{{1|{{{URL|{{{url}}}}}}}}} {{{2|{{{NAME|{{{name|}}}}}}}}}}}]</span></onlyinclude>
{{/doc}}
dd273ef18593319a16c658c2a97cdea9b2810bd7
模板:Date
10
676
1848
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{safesubst:<noinclude/>#switch:none
|{{safesubst:<noinclude/>#iferror: {{safesubst:<noinclude/>#time:Y_M_d|{{{1|}}} }} | none }} <noinclude><!-- #time: can't handle --></noinclude>
|{{safesubst:<noinclude/>#iferror: {{safesubst:<noinclude/>#expr: {{{1|}}}+0 }}
|<noinclude><!--not a pure number--></noinclude>
|{{safesubst:<noinclude/>#ifexpr: {{{1|}}}+0 > 10000000000000
|<noinclude><!-- a yyyymmddhhmmss timestamp --></noinclude>
|{{safesubst:<noinclude/>#ifeq: {{safesubst:<noinclude/>#expr:{{{1|}}}+0}} | {{{1|}}}
| none <noinclude><!-- pure number eg 123.456 --></noinclude>
| <noinclude><!-- assume yy-mm-dd --></noinclude>
}}
}}
}}
|{{safesubst:<noinclude/>#switch: {{safesubst:<noinclude/>lc:{{{2|}}}}} | none | asis | link | lnone =none }}
|{{safesubst:<noinclude/>#ifexpr: {{safesubst:<noinclude/>#time:Y|{{{1|}}} }} < 1000 | none }}
|{{safesubst:<noinclude/>#switch: {{safesubst:<noinclude/>#time:Ynj|{{{1|}}} }}|100031|110031|130031|140031|150031=none}}
|= {{safesubst:<noinclude/>#if:{{{1|}}}
|{{safesubst:<noinclude/>#switch:{{{2}}}
|link|lnone|l=[[{{{1}}}]]
|{{{1}}}
}}
}}<noinclude><!-- error or "none", so no formatting --></noinclude>
|<noinclude><!-- continue with formatting --></noinclude>
{{safesubst:<noinclude/>#ifeq:<noinclude><!--
--></noinclude>{{safesubst:<noinclude/>#time:Y|{{{1}}} 2008}}<noinclude><!--
--></noinclude>{{safesubst:<noinclude/>#iferror: {{safesubst:<noinclude/>#ifexpr: {{{1}}}>10000000000000 | no }} | }}<noinclude><!--
--></noinclude>{{safesubst:<noinclude/>#time:Y|{{{1}}} 2004}}
|20082004
|<noinclude><!-- no year --></noinclude>
{{safesubst:<noinclude/>#ifeq:{{safesubst:<noinclude/>#time:d|{{{1}}} 2036}}|{{safesubst:<noinclude/>#time:d|{{{1}}} }}
|<noinclude><!-- month+day --></noinclude>{{safesubst:<noinclude/>#time:
{{safesubst:<noinclude/>#switch: {{safesubst:<noinclude/>lc: {{safesubst:<noinclude/>#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
| lmdy | liso | lymd = [[:F j]]
| mdy | iso | ymd = F j
| ldmy | l = [[:j F]]
| #default = j F
}}|{{{1}}} 2000 }}<noinclude><!-- default='dmy' or null or "" or unsupported option --></noinclude>
|<noinclude><!-- month only --></noinclude>{{safesubst:<noinclude/>#time:
{{safesubst:<noinclude/>#switch: {{safesubst:<noinclude/>lc: {{safesubst:<noinclude/>#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
| lmdy | liso | lymd
| ldmy | l = [[F]]
| #default = F
}}|{{{1}}} 2000 }}<noinclude><!-- default='dmy'/'mdy'/'ymd'/'iso'/null/""/unsupported opt --></noinclude>
}}
|<noinclude><!-- with year--></noinclude>
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#iferror:{{safesubst:<noinclude/>#time:j|2 {{{1|}}}}}|*D*|{{safesubst:<noinclude/>#iferror:{{safesubst:<noinclude/>#time:j|2000 {{{1|}}}}}|*D*| }}}}
|<noinclude><!-- day+month+year --></noinclude>{{safesubst:<noinclude/>#time:
{{safesubst:<noinclude/>#switch: {{safesubst:<noinclude/>lc: {{safesubst:<noinclude/>#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
| lmdy = [[:F j]], [[Y]]
| mdy = F j, Y
| liso = [[Y|Y-]][[F j|m-d]]<noinclude><!-- i.e. [[Y-m-d]] --></noinclude>
| iso = Y-m-d
| lymd = [[Y]] [[:F j]]
| ymd = Y F j
| ldmy | l = [[:j F]] [[Y]]
| #default = j F Y
}}|{{{1|}}} }}<noinclude><!-- #default='dmy' or null or "" or unsupported option --></noinclude>
|<noinclude><!-- month+year --></noinclude>{{safesubst:<noinclude/>#time:
{{safesubst:<noinclude/>#switch: {{safesubst:<noinclude/>lc: {{safesubst:<noinclude/>#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
| lmdy | liso | lymd | ldmy | l = [[:F Y]]
| #default = F Y
}}|{{{1|}}} }}<noinclude><!-- default='dmy'/'iso'/'mdy'/null/""/unsupported option --></noinclude>
}}
}}
}}<noinclude>
{{/doc}}
</noinclude>
337eea9ac9d050561872438c4e50479903f62000
模块:Key
828
677
1849
2023-03-12T07:08:58Z
Pio
2
导入1个版本
Scribunto
text/plain
-- This module implements {{key press}}.
local kbdPrefix = '<kbd class="keyboard-key nowrap">'
local kbdSuffix = '</kbd>'
local keyText = {
['caps lock'] = '⇪ Caps Lock',
['[[caps lock]]'] = '⇪ [[Caps Lock]]',
['shift'] = '⇧ Shift',
['[[shift key|shift]]'] = '⇧ [[Shift key|Shift]]',
['enter'] = '↵ Enter',
['[[enter key|enter]]'] = '↵ [[Enter key|Enter]]',
['cmd'] = '⌘ Cmd',
['[[command key|cmd]]'] = '⌘ [[Command key|Cmd]]',
['command'] = '⌘ Command',
['[[command key|command]]'] = '⌘ [[Command key|Command]]',
['opt'] = '⌥ Opt',
['[[option key|opt]]'] = '⌥ [[Option key|Opt]]',
['option'] = '⌥ Option',
['[[option key|option]]'] = '⌥ [[Option key|Option]]',
['tab'] = 'Tab ↹',
['[[tab key|tab]]'] = '[[Tab key|Tab]] ↹',
['backspace'] = '← Backspace',
['[[backspace]]'] = '← [[Backspace]]',
['win'] = '⊞ Win',
['[[windows key|win]]'] = '⊞ [[Windows key|Win]]',
['menu'] = '≣ Menu',
['[[menu key|menu]]'] = '≣ [[Menu key|Menu]]',
['up'] = '↑',
['[[arrow keys|up]]'] = '[[Arrow keys|↑]]',
['down'] = '↓',
['[[arrow keys|down]]'] = '[[Arrow keys|↓]]',
['left'] = '←',
['[[arrow keys|left]]'] = '[[Arrow keys|←]]',
['right'] = '→',
['[[arrow keys|right]]'] = '[[Arrow keys|→]]',
['asterisk'] = '*',
['hash'] = '#',
['[[#]]'] = '[[Number sign|#]]',
['colon'] = ':',
['[[:]]'] = '[[Colon (punctuation)|:]]',
['pipe'] = '|',
['[[|]]'] = '[[Pipe symbol||]]',
['semicolon'] = ';',
['[[;]]'] = '[[Semi-colon|;]]',
['equals'] = '=',
-- Left & right analog sticks.
['l up'] = 'L↑',
['l down'] = 'L↓',
['l left'] = 'L←',
['l right'] = 'L→',
['l ne'] = 'L↗',
['l se'] = 'L↘',
['l nw'] = 'L↖',
['l sw'] = 'L↙',
['r up'] = 'R↑',
['r down'] = 'R↓',
['r left'] = 'R←',
['r right'] = 'R→',
['r ne'] = 'R↗',
['r se'] = 'R↘',
['r nw'] = 'R↖',
['r sw'] = 'R↙',
-- PlayStation.
['ex'] = '×',
['circle'] = '○',
['square'] = '□',
['triangle'] = '△',
-- Nintendo 64 and GameCube.
['c up'] = 'C↑',
['c down'] = 'C↓',
['c left'] = 'C←',
['c right'] = 'C→',
['c ne'] = 'C↗',
['c se'] = 'C↘',
['c nw'] = 'C↖',
['c sw'] = 'C↙',
}
local keyAlias = {
-- ['alternate name for key (alias)'] = 'name for key used in key table'
['[[cmd key|cmd]]'] = '[[command key|cmd]]',
['[[cmd key|command]]'] = '[[command key|command]]',
['[[opt key|opt]]'] = '[[option key|opt]]',
['[[option key]]'] = '[[option key|option]]',
['[[opt key|option]]'] = '[[option key|option]]',
['[[win key|win]]'] = '[[windows key|win]]',
['*'] = 'asterisk',
['#'] = 'hash',
[':'] = 'colon',
[';'] = 'semicolon',
['l-up'] = 'l up',
['l-down'] = 'l down',
['l-left'] = 'l left',
['l-right'] = 'l right',
['l-ne'] = 'l ne',
['l-se'] = 'l se',
['l-nw'] = 'l nw',
['l-sw'] = 'l sw',
['r-up'] = 'r up',
['r-down'] = 'r down',
['r-left'] = 'r left',
['r-right'] = 'r right',
['r-ne'] = 'r ne',
['r-se'] = 'r se',
['r-nw'] = 'r nw',
['r-sw'] = 'r sw',
['ps x'] = 'ex',
['ps c'] = 'circle',
['ps s'] = 'square',
['ps t'] = 'triangle',
['c-up'] = 'c up',
['c-down'] = 'c down',
['c-left'] = 'c left',
['c-right'] = 'c right',
['c-ne'] = 'c ne',
['c-se'] = 'c se',
['c-nw'] = 'c nw',
['c-sw'] = 'c sw',
}
local Collection = {}
Collection.__index = Collection
do
function Collection:add(item)
if item ~= nil then
self.n = self.n + 1
self[self.n] = item
end
end
function Collection:join(sep)
return table.concat(self, sep)
end
function Collection:sort(comp)
table.sort(self, comp)
end
function Collection.new()
return setmetatable({n = 0}, Collection)
end
end
local function keyPress(args)
local chainNames = {
'chain first',
'chain second',
'chain third',
'chain fourth',
'chain fifth',
'chain sixth',
'chain seventh',
'chain eighth',
'chain ninth',
}
local result = Collection.new()
local chainDefault = args.chain or '+'
for i, id in ipairs(args) do
if i > 1 then
result:add(args[chainNames[i - 1]] or chainDefault)
end
local lc = id:lower()
local text = keyText[lc] or keyText[keyAlias[lc]] or id
result:add(kbdPrefix .. text .. kbdSuffix)
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Key/styles.css'}
} .. result:join()
end
local function keypress(frame)
-- Called by "{{key press|...}}".
-- Using the template doubles the post‐expand include size.
return keyPress(frame:getParent().args)
end
local function press(frame)
-- Called by "{{#invoke:key|press|...}}".
return keyPress(frame.args)
end
return {
keypress = keypress,
press = press,
}
65d131138a316efe3789d0e9be9f1af6327d4e6b
模板:Key press
10
678
1850
2023-03-12T07:08:58Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{{{{|safesubst:}}}#invoke:key|keypress}}</includeonly><noinclude>
{{/doc}}
</noinclude>
6fee75af438fb6f8d21f10d656fe3c6a6f99162d
模板:Infobox/doc
10
583
1755
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
Please refer to {{t|Infobox}} on Wikipedia for more details
<noinclude></noinclude>
<includeonly>
<!-- Template catergories go here -->
[[Category:Infobox templates]]
</includeonly>
54039c2ca7b144080d1e323c928cc219ca1eaa03
模块:Hatnote/doc
828
612
1784
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Hatnote''' is a meta-module that provides various functions for making hatnotes. It implements the {{tl|hatnote}} template, for use in hatnotes at the top of pages, and the {{tl|format link}} template, which is used to format a wikilink for use in hatnotes. It also contains a number of helper functions for use in other Lua hatnote modules.
6bb0dab88d7fecefdaa0dd1442d6184ccf61c689
模板:Main/doc
10
681
1853
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This template is used at the start of a section to link to the main article on that subject.
==TemplateData==
<templatedata>
{
"description": "This template is used after the heading of a section, to link to a sub-article (or sub-articles) that is entirely about the topic of the section. The template will display, in italics, \"Main article: Article 1, Article 2 and Article 3\"",
"params": {
"1": {
"label": "Page 1",
"description": "The name of the first page that you want to link to. If this is not specified, the current page name (with no namespace prefix) is used instead. ",
"type": "wiki-page-name",
"required": false,
"suggested": true
},
"2": {
"label": "Page 2",
"description": "The name of the second page that you want to link to.",
"type": "wiki-page-name",
"required": false
},
"3": {
"label": "Page 3",
"description": "The name of the third page that you want to link to. More pages can be added using the parameters \"4\", \"5\", etc.",
"type": "wiki-page-name",
"required": false
},
"l1": {
"type": "string",
"label": "Label 1",
"description": "What the first linked page is to be displayed as.",
"aliases": [
"label 1"
]
},
"l2": {
"label": "Label 2",
"description": "What the second linked page is to be displayed as.",
"type": "string",
"aliases": [
"label 2"
]
},
"l3": {
"label": "Label 3",
"description": "What the third linked page is to be displayed as. Other labels can be added by using increasing numbers (starting with \"l4\" for page 4) as parameter names.",
"type": "string",
"aliases": [
"label 3"
]
},
"selfref": {
"type": "boolean",
"label": "Self reference",
"description": "Set to \"yes\" if the template is a self-reference to Wikipedia that would not make sense on mirrors or forks of the Wikipedia site."
}
},
"paramOrder": [
"1",
"2",
"3",
"l1",
"l2",
"l3",
"selfref"
],
"format": "{{_|_ = _}}\n"
}
</templatedata>
<includeonly>[[Category:General wiki templates|{{PAGENAME}}]]</includeonly>
65d39218db4bbb35702e740c5810b5d21d9d2d36
模板:For/doc
10
682
1854
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This template is used at the top of pages for simple [[Help:Disambiguation|disambiguations]].
==TemplateData==
<templatedata>
{
"description": "This template lists up to four articles on alternative meanings of a term. For further details and examples see the template documentation.",
"params": {
"1": {
"label": "Description",
"description": "a phrase describing the major alternative, or a general term for all alternative meanings",
"default": "other uses",
"type": "string",
"required": false,
"example": "other people with the surname Smith"
},
"2": {
"label": "First link",
"description": "A page to link to; usually a disambiguation page or the most likely other meaning.",
"default": "{{PAGENAME}} (disambiguation)",
"type": "wiki-page-name",
"required": false
},
"3": {
"label": "Second link",
"description": "A page to link to for another meaning, if any.",
"type": "wiki-page-name",
"required": false
},
"4": {
"label": "Third link",
"description": "A page to link to for another meaning, if any.",
"type": "wiki-page-name",
"required": false
},
"5": {
"label": "Fourth link",
"description": "A page to link to for another meaning, if any.",
"type": "wiki-page-name",
"required": false
}
},
"format": "inline"
}
</templatedata>
<includeonly>[[Category:General wiki templates|{{PAGENAME}}]]</includeonly><noinclude></noinclude>
c9fb32d25e077bce6173cef359ef424f40de7c7c
模块:Infobox/doc
828
683
1855
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Infobox''' is a module that implements the {{tl|Infobox}} template. Please see the template page for usage instructions.
bcb84c29a6997fa6a352e68a133f0adc8f6edd47
模板:Redirect/doc
10
685
1857
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
This template produces a hatnote:
* {{tlx|Redirect|Foo}} → {{Redirect|Foo}}
Its purpose is to reduce confusion by helping users get to their intended page if they were redirected to another page while, for example, searching for a topic. An example would be when a user searches for [[Roberts Space Industries]] (as in [[Roberts Space Industries Corporate|the publisher]]), but ends up on the page titled [[Roberts Space Industries]] (as in the in-game company) after being redirected. A {{para|text}} option adds text to the end; note that this should be only used when truly necessary, and the other hatnote templates listed below don't suffice.
== Examples ==
* {{tlx|Redirect|Foo}} → {{Redirect|Foo}}
* {{tlx|Redirect|REDIRECT<nowiki>||</nowiki>PAGE1}} → {{Redirect|REDIRECT||PAGE1}}
* {{tlx|Redirect|REDIRECT|USE1|PAGE1}} → {{Redirect|REDIRECT|USE1|PAGE1}}
* {{tlx|Redirect|REDIRECT|USE1|PAGE1|USE2|PAGE2|USE3|PAGE3}} → {{Redirect|REDIRECT|USE1|PAGE1|USE2|PAGE2|USE3|PAGE3}}
* {{tlx|Redirect|REDIRECT|USE1|PAGE1|and|PAGE2}} → {{Redirect|REDIRECT|USE1|PAGE1|and|PAGE2}}
* {{tlx|Redirect|REDIRECT|USE1|PAGE1|USE2|PAGE2|and|PAGE3}} → {{Redirect|REDIRECT|USE1|PAGE1|USE2|PAGE2|and|PAGE3}}
* {{tlx|Redirect|Achilleus|the Emperor with this name|Achilleus (emperor)|other uses|Achilles (disambiguation)}} (as used on the page [[Achilles]]) → {{Redirect|Achilleus|the Emperor with this name|Achilleus (emperor)|other uses|Achilles (disambiguation)}}
== TemplateData ==
<templatedata>
{
"params": {
"1": {
"label": "Redirecting page",
"description": "Name of page that redirects here",
"type": "wiki-page-name",
"required": true
},
"2": {
"label": "Use 1",
"description": "Displayed as: For Use 1, see ... If left empty, defaults to For other uses, see ...",
"type": "line",
"required": false
},
"3": {
"label": "Target 1",
"description": "Page to link to. Default is [[PAGENAME (disambiguation)]].",
"type": "wiki-page-name",
"required": false
},
"4": {
"label": "Use 2",
"description": "Second use. Can be 'and' to give: For Use 1, see [[Target1]] and [[Target2]]",
"type": "line",
"required": false
},
"5": {
"label": "Target 2",
"description": "Page to link second use to.",
"type": "wiki-page-name",
"required": false
},
"6": {
"label": "Use 3",
"description": "Third use, can be 'and'",
"type": "line",
"required": false
},
"7": {
"label": "Target 3",
"description": "Page to link third use to.",
"type": "wiki-page-name",
"required": false
},
"text": {
"label": "Custom text",
"type": "line",
"description": "Text to be appended to the end."
}
},
"description": "This template produces a hatnote similar to:\n\n\"Foo\" redirects here. For other uses, see [[Foo (disambiguation)]].",
"format": "inline"
}
</templatedata>
<includeonly>
[[Category:Internal link templates]]
</includeonly>
00b95bcdd29e889ff87bb552a50fdd2406f38207
模块:Redirect hatnote/doc
828
686
1858
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Moduke:Redirect hatnote''' produces a hatnote for disambiguating a page that is linked to by a given redirect. It implements the {{tl|redirect}} hatnote template.
c1ee82205cd94fe0b662e08bda6e4d82d9327b64
模块:List/doc
828
688
1860
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:List''' outputs various kinds of lists. At present, it supports bulleted lists, unbulleted lists, horizontal lists, ordered lists (numbered or alphabetical), and horizontal ordered lists. It allows for easy css styling of the list or of the individual list items.
== Usage ==
; Quick usage
<pre><nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function''<nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>...<nowiki>}}</nowiki></pre>
; All parameters
<pre>
<nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function''
<nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>...
<nowiki>|start = </nowiki>''start number for ordered lists''
<nowiki>|type = </nowiki>''type of numbering for ordered lists''
<nowiki>|list_style_type = </nowiki>''type of marker for ordered lists (uses CSS)''
<nowiki>|class = </nowiki>''class''
<nowiki>|style = </nowiki>''style''
<nowiki>|list_style = </nowiki>''style for the list''
<nowiki>|item_style = </nowiki>''style for all list items''
<nowiki>|item1_style = </nowiki>''style for the first list item''<nowiki> |item2_style = </nowiki>''style for the second list item''<nowiki> |</nowiki>...
<nowiki>|item1_value = </nowiki>''value for the first list item''<nowiki> |item2_value = </nowiki>''value for the second list item''<nowiki> |</nowiki>...
<nowiki>|indent = </nowiki>''indent for horizontal lists''
<nowiki>}}</nowiki>
</pre>
; Arguments passed from parent template
<pre><nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function''<nowiki>}}</nowiki></pre>
; Functions
{| class="wikitable"
|-
! Function name
! Produces
! Example output
! Template using the function
|-
| <code>bulleted</code>
| Bulleted lists
| {{#invoke:list|bulleted|First item|Second item|Third item}}
| {{tlx|bulleted list}}
|-
| <code>unbulleted</code>
| Unbulleted lists
| {{#invoke:list|unbulleted|First item|Second item|Third item}}
| {{tlx|unbulleted list}}
|-
| <code>horizontal</code>
| Horizontal bulleted lists
| {{#invoke:list|horizontal|First item|Second item|Third item}}
| {{tlx|hlist}}
|-
| <code>ordered</code>
| Ordered lists (numbered lists and alphabetical lists)
| {{#invoke:list|ordered|First item|Second item|Third item}}
| {{tlx|ordered list}}
|-
| <code>horizontal_ordered</code>
| Horizontal ordered lists
| {{#invoke:list|horizontal_ordered|First item|Second item|Third item}}
|
|}
== Parameters ==
* Positional parameters (<code>1</code>, <code>2</code>, <code>3</code>...) - these are the list items. If no list items are present, the module will output nothing.
* <code>start</code> - sets the start item for ordered lists. This can be a start number for numbered lists, or a start letter for alphabetical lists. Horizontal ordered lists only support numbers.
* <code>type</code> - the type of marker used in ordered lists. Possible values are "1" for numbers (the default), "A" for uppercase letters, "a" for lowercase letters, "I" for uppercase {{WP|ref=no|Roman_numerals|text=Roman numerals}}, and "i" for lowercase Roman numerals. Not supported in horizontal ordered lists. See also the <code>list_style_type</code> parameter.
* <code>list_style_type</code> - the type of marker used in ordered lists. This uses CSS styling, and has more types available than the <code>type</code> parameter, which uses an {{WP|ref=no|html_attribute|text=html attribute}}. Possible values are listed at [http://www.w3schools.com/cssref/pr_list-style-type.asp W3schools' list-style-type page]. Support may vary by browser. <code>list-style-type</code> is an alias for this parameter.
* <code>class</code> - a custom class for the {{tag|div}} tags surrounding the list, e.g. <code>plainlinks</code>.
* <code>style</code> - a custom css style for the {{tag|div}} tags surrounding the list, e.g. <code>font-size: 90%;</code>.
* <code>list_style</code> - a custom css style for the list itself. The format is the same as for the {{para|style}} parameter.
* <code>item_style</code> - a custom css style for all of the list items (the {{tag|li}} tags). The format is the same as for the {{para|style}} parameter.
* <code>item1_style</code>, <code>item2_style</code>, <code>item3_style</code>... - custom css styles for each of the list items. The format is the same as for the {{para|style}} parameter.
* <code>item1_value</code>, <code>item2_value</code>, <code>item3_value</code>... - custom value for the given list item. List items following the one given will increment from the specified value. The value should be a positive integer. (Note that this option only has an effect on ordered lists.)
* <code>indent</code> - this parameter indents the list, for horizontal and horizontal ordered lists only. The value must be a number, e.g. <code>2</code>. The indent is calculated in {{WP|ref=no|Em_(typography)|text=em}}, and is 1.6 times the value specified. If no indent is specified, the default is zero.
== Examples ==
; Bulleted lists
{| class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{#invoke:list|bulleted|First item|Second item|Third item}}</nowiki></code>
| {{#invoke:list|bulleted|First item|Second item|Third item}}
|-
| <code><nowiki>{{#invoke:list|bulleted|First item|Second item|Third item|item_style=color:blue;}}</nowiki></code>
| {{#invoke:list|bulleted|First item|Second item|Third item|item_style=color:blue;}}
|-
| <code><nowiki>{{#invoke:list|bulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}</nowiki></code>
| {{#invoke:list|bulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
|}
; Unbulleted lists
{| class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item}}</nowiki></code>
| {{#invoke:list|unbulleted|First item|Second item|Third item}}
|-
| <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item|item_style=color:blue;}}</nowiki></code>
| {{#invoke:list|unbulleted|First item|Second item|Third item|item_style=color:blue;}}
|-
| <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}</nowiki></code>
| {{#invoke:list|unbulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
|}
; Horizontal lists
{| class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{#invoke:list|horizontal|First item|Second item|Third item}}</nowiki></code>
| {{#invoke:list|horizontal|First item|Second item|Third item}}
|-
| <code><nowiki>{{#invoke:list|horizontal|First item|Second item|Third item|indent=2}}</nowiki></code>
| {{#invoke:list|horizontal|First item|Second item|Third item|indent=2}}
|}
; Unbulleted lists
{| class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item}}</nowiki></code>
| {{#invoke:list|unbulleted|First item|Second item|Third item}}
|-
| <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item|item_style=color:blue;}}</nowiki></code>
| {{#invoke:list|unbulleted|First item|Second item|Third item|item_style=color:blue;}}
|-
| <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}</nowiki></code>
| {{#invoke:list|unbulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
|}
; Ordered lists
{| class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{#invoke:list|ordered|First item|Second item|Third item}}</nowiki></code>
| {{#invoke:list|ordered|First item|Second item|Third item}}
|-
| <code><nowiki>{{#invoke:list|ordered|First item|Second item|Third item|start=3}}</nowiki></code>
| {{#invoke:list|ordered|First item|Second item|Third item|start=3}}
|-
| <code><nowiki>{{#invoke:list|ordered|First item|Second item|Third item|type=i}</nowiki></code>
| {{#invoke:list|ordered|First item|Second item|Third item|type=i}}
|-
| <code><nowiki>{{#invoke:list|ordered|First item|Second item|Third item|list_style_type=lower-greek}}</nowiki></code>
| {{#invoke:list|ordered|First item|Second item|Third item|list_style_type=lower-greek}}
|}
; Horizontal ordered lists
{| class="wikitable"
! Code !! Result
|-
| <code><nowiki>{{#invoke:list|horizontal_ordered|First item|Second item|Third item}}</nowiki></code>
| {{#invoke:list|horizontal_ordered|First item|Second item|Third item}}
|-
| <code><nowiki>{{#invoke:list|horizontal_ordered|First item|Second item|Third item|start=3}}</nowiki></code>
| {{#invoke:list|horizontal_ordered|First item|Second item|Third item|start=3}}
|-
| <code><nowiki>{{#invoke:list|horizontal_ordered|First item|Second item|Third item|indent=2}}</nowiki></code>
| {{#invoke:list|horizontal_ordered|First item|Second item|Third item|indent=2}}
|}
51238475737ef3e8f109ddd0356565bfc4092d8a
模板:About/doc
10
689
1861
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{t|About}} is a commonly used hatnote template, and should be placed at the top of an article, linking the reader to other articles with similar titles or concepts that they may have been seeking instead.
==TemplateData==
<templatedata>
{
"description": "This template is a hatnote in the format \"This page is about … For other uses …\".",
"params": {
"1": {
"label": "Page description",
"type": "string",
"required": true,
"description": "What the page this template is placed on is about (\"This page is about …\")"
},
"2": {
"label": "Other page 1 description",
"type": "string",
"description": "What the first other page is about. If unused or blank, defaults to \"For other uses\".",
"suggested": true
},
"3": {
"label": "Other page 1 title",
"type": "wiki-page-name",
"description": "The title of the first other page. If unused, defaults to \"[page title] (disambiguation)\".",
"suggested": true
},
"4": {
"label": "Other page 2 description",
"type": "string",
"description": "What the second other page is about."
},
"5": {
"label": "Other page 2 title",
"type": "wiki-page-name",
"description": "The title of the second other page. If unused or blank and parameter 4 exists, defaults to \"[page title] (disambiguation)\"."
},
"6": {
"label": "Other page 3 description",
"type": "string",
"description": "What the third other page is about."
},
"7": {
"label": "Other page 3 title",
"type": "wiki-page-name",
"description": "The title of the third other page. If unused or blank and parameter 6 exists, defaults to \"[page title] (disambiguation)\"."
},
"8": {
"label": "Other page 4 description",
"type": "string",
"description": "What the fourth other page is about."
},
"9": {
"label": "Other page 4 title",
"type": "wiki-page-name",
"description": "The title of the fourth other page. If unused or blank and parameter 8 exists, defaults to \"[page title] (disambiguation)\"."
},
"section": {
"type": "string",
"description": "Pass \"yes\" in this parameter to get wording appropriate for use at the top of a section.",
"autovalue": "yes"
},
"text": {
"label": "Custom text",
"type": "string",
"description": "Text to be appended to the end."
}
}
}
</templatedata>
cffb4233c7a75ad9c922fb6e93f26ec3564e9bb5
模块:About/doc
828
690
1862
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Hatnote''' implements the {{tl|about}} template.
25a0c3dfe029b895841b399490faa305819f565a
模块:Main/doc
828
691
1863
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Main''' produces a link to a main article or articles. It implements the {{tl|main}} template. Normally, it produces a link like "Main article: A". If used in the [[Help:Category|category]] namespace, it produces a link like "The main article for this category is A". It is possible to specify multiple articles, and in this case plural wording is used automatically. If the first link is not an article, the module uses the wording "Main page" instead of "Main article". See [[Wikipedia:Module:Main|Module:Main]] on Wikipedia for more details.
<includeonly>
<!-- Categories go here and interwikis go in Wikidata. -->
</includeonly>
bb65f3e050f29ff19f2e7adc84d7cc6d1db766e9
模块:For/doc
828
692
1864
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:For''' implements the {{tl|For}} template.
6002c0b53125a69a947f2137ea042900e9ea5f7b
模板:See also/doc
10
693
1865
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This template is used to point to a small number of other related titles at the top of article sections.
==TemplateData==
<templatedata>
{
"description": "This template creates a hatnote to point to a small number of related pages. It is placed at the top of a section, directly underneath the section heading.",
"params": {
"1": {
"label": "Page 1",
"description": "The name of the first page that you want to link to.",
"type": "wiki-page-name",
"required": true,
"example": "Article name"
},
"2": {
"label": "Page 2",
"description": "The name of the second page that you want to link to.",
"type": "wiki-page-name",
"required": false
},
"3": {
"label": "Page 3",
"description": "The name of the third page that you want to link to. More pages can be added using the parameters \"4\", \"5\", \"6\", etc.",
"type": "wiki-page-name",
"required": false
},
"label 1": {
"label": "Label 1",
"type": "string",
"description": "What the first linked article is to be displayed as. ",
"aliases": [
"l1"
]
},
"label 2": {
"label": "Label 2",
"type": "string",
"description": "What the second linked article is to be displayed as.",
"aliases": [
"l2"
]
},
"selfref": {
"type": "boolean",
"label": "Self reference",
"description": "Set to \"yes\" if the template is a self-reference to Wikipedia that would not make sense on mirrors or forks of the Wikipedia site.",
"example": "yes",
"default": "no"
},
"category": {
"label": "Category",
"description": "Set to \"no\", \"n\", \"false\", or \"0\" to suppresses the error tracking category (Category:Hatnote templates with errors). This only has an effect if no page names are specified.",
"type": "boolean",
"default": "yes",
"example": "no"
},
"label 3": {
"aliases": [
"l3"
],
"type": "string",
"label": "Label 3",
"description": "What the third linked article is to be displayed as. Other labels can be added by using increasing numbers (starting with \"label 4\" or \"l4\" for page 4) as parameter names."
}
},
"format": "inline"
}
</templatedata>
<includeonly>[[Category:General wiki templates|{{PAGENAME}}]]</includeonly><noinclude></noinclude>
4fb83ebb72210bebca1e06a369535f725a8c1763
模块:Labelled list hatnote/doc
828
694
1866
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Labelled list hatnote''' provides a handful of functions that make it easy to implement hatnotes that take the form of a label in front of a list of pages. See [[Wikipedia:Module:Labelled list hatnote|Module:Labelled list hatnote]] on Wikipedia for more details.
<includeonly>
<!-- Categories below this line -->
</includeonly>
77a9d75ef673e959898b01d5724cce6961a6bd19
模板:DependencyList/doc
10
696
1868
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
This template is meant to be used on module documentations.
{{T|DependencyList|<Module name>|category=<true/false>|compact=<true/false>}}
All parameters are optional. If <code>Module name</code> is omitted the page name will be used instead; <code>/doc</code> is automatically removed.
If <code>category</code> is <code>false</code> then no categories will be added to the page, the default value is <code>true</code>.
If <code>compact</code> is <code>true</code> links will be separated by commas instead of every link on a new line.
==Examples==
{{T|DependencyList|Module:For}}
{{DependencyList|Module:For|category=false}}
{{T|DependencyList|Module:Infobox|compact=true}}
{{DependencyList|Module:Infobox|compact=true|category=false}}
349c7499758bd23a5d40a7c989765cac869902ce
模块:Hatnote list/doc
828
697
1869
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Hatnote list''' produces and formats lists for use in hatnotes. In particular, it implements the for-see list, i.e. lists of "For X, see Y" statements, as used in {{t|about}}, {{t|redirect}}, and their variants. Also introduced are andList & orList helpers for formatting lists with those conjunctions.
2d32995da50176839ef11e92f9df1eef426ce55a
模板:Shortcut/doc
10
698
1870
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{Template shortcut|Shc|Short|Shorthand}}
{{t|Shortcut}} adds a shortcut box to an article or a section which provides the shortcut link to that article or section. See [[Wikipedia:Template:Shortcut|Template:Shortcut]] on Wikipedia for more details.
<includeonly>[[Category:Internal link templates|{{PAGENAME}}]]</includeonly><noinclude></noinclude>
71b37cb08ded05234e67ba8ca1ebd135a732ef59
模块:Shortcut/doc
828
699
1871
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Shortcut''' makes a box showing the shortcut links to a page.
9c48ba9ef67f8d3d2b227d307a18cb6cb578461b
模板:Template shortcut/doc
10
700
1872
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{tsh|tsh}}
This template displays one or more of a template's shortcuts (that is, redirects, also known as aliases, as in the box appearing at the right. {{tl|Tsh}} is a shortcut to this template, {{<nowiki />template shortcut}}, and can be used in its place. See [[Wikipedia:Template:Template shortcut]] for more details. Note that there are no optional parameter in this template.
== Usage ==
Place this template and its list of few to one, carefully selected shortcut(s) at the top of the template documentation page's [[Wikipedia:Wikipedia:Wikitext|wikitext]], right underneath {{tl|Documentation}}. In the saved, rendered text, those shortcuts will appear in this template's Shortcut(s) box, whose title will reflect the number of list items by automatically being singular or plural in form.
===Which ones to display here===
Although the template can show up to ten shortcuts, you are ''encouraged to choose well'' which ones to display in this template's box. Even if many redirects exist, ''two or three at the most'' is almost always enough. By keeping the number of redirects presented in the Shortcut box small, it makes it easier to remember them, and the documentation is kept well organized.
===Where to list any others===
List others in the Redirects section of the template documentation. Again, not all of them need to be listed; some shortcuts are there just for historical reasons, and others differ only in minor points such as white spaces or capitalization. Such shortcut-name variations are unnecessary to list at all—just list the standard, most common version of such a variation.
<includeonly>
[[Category:Internal link templates|{{PAGENAME}}]]
[[Category:Template documentation]]</includeonly>
3b0d3a5a1d00fc20442d000ff747d5f6013707ea
模块:Namespace detect/config
828
701
1873
2023-03-12T07:08:59Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
模块:Namespace detect/data
828
702
1874
2023-03-12T07:08:59Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
模块:Pagetype/config
828
703
1875
2023-03-12T07:08:59Z
Pio
2
导入1个版本
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['starcitizen'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'module'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
7f21a2df1bb5a2781395c08cc395c6827568934e
模块:Key/doc
828
704
1876
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
Implements {{tl|key press}}
c5e500d07bd14b48f39566d7eccb2770dd556f25
模板:Key press/doc
10
705
1877
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This is the {{tl|key press}} template primarily designed to illustrate keys and keystrokes on a computer keyboard. With additional parameters, a single template can even illustrate a combination of multiple ''simultaneous'' keystrokes. A sequence of keystrokes, on the other hand, need to be demonstrated with separate templates.
Example
: {{tc|key press|A}} → {{key press|A}}
As lower-case alphabetic characters a–z do not appear on most keyboards, they should not be used as parameters.
===Keystroke combinations===
To illustrate keystroke combinations, just use extra parameters:
: {{tc|key press|Alt|P}} → {{key press|Alt|P}}
: {{tc|key press|Ctrl|Alt|Del}} → {{key press|Ctrl|Alt|Del}}
When you feed several key names to this template, it adds a "+" (or whatever the contents of the optional ''chain'' parameter) with no spaces around. This means it won't line wrap. But when you show key combinations for instance in a table that might cause items to be too wide. Instead manually build the key combination with spaces around the "+" so it can line wrap:
: {{tc|key press|Ctrl}} + {{tlc|key press|Alt}} + {{tlc|key press|Del}} → {{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}}
: {{tc|key press|Ctrl|Alt|Del|5=chain=&#32;+&#32;}} → {{key press|Ctrl|Alt|Del|chain= + }}
To illustrate sequences where all keys do not need to be pressed simultaneously, the plus signs can be omitted by setting ''chain=''. For example, in most Windows systems in North America and Western Europe, Alt codes can be used to insert the plus-minus sign (±) by holding down the {{key press|Alt}} key while typing <code>0177</code> with the numeric keypad:
: {{tc|key press|Alt|0}}{{tlc|key press|1|7|7|chain{{=}}}} → {{key press|Alt|0}}{{key press|1|7|7|chain=}}
An example of a use case where more than 5 might be used is explaining usage of a macro (keyboard shortcut) created by a third-party application:
: {{tc|Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}} → {{Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}}
===Wikilinks===
If there is an article about the key you can wikilink the key's name like any other wiki text. Like this:
* {{tc|key press|[[Alt key|Alt]]}} → {{key press|[[Alt key|Alt]]}}
If you are wikilinking the keys, please ensure that you are piping to the correct page (e.g. <code><nowiki>[[Alt key|Alt]]</nowiki></code> instead of <code><nowiki>[[Alt]]</nowiki></code>, which leads to a disambiguation page).
===Wiki markup characters===
Some wiki markup characters, like the pipe symbol, the semicolon and the equals sign, need to be entered using the {{tlx|!}}, {{tlx|;}} and {{tlx|{{=}}}} templates or as an HTML entity &#124;, &#59;, &#61; respectively:
* {{tc|key press|{{tc|pipe}}}} → {{key press|{{pipe}}}}
* {{tc|key press|&#124;}} → {{key press||}}
* {{tc|key press|{{tc|;}}}} → {{key press|{{;}}}}
* {{tc|key press|&#59;}} → {{key press|;}}
* {{tc|key press|{{tc|=}}}} → {{key press|{{=}}}}
* {{tc|key press|&#61;}} → {{key press|=}}
However, if the characters are marked as wikilinks, they can be entered as such:
* {{tc|key press|<nowiki>[[|]]</nowiki>}} → {{key press|[[|]]}}
* {{tc|key press|<nowiki>[[;]]</nowiki>}} → {{key press|[[;]]}}
* {{tc|key press|<nowiki>[[=]]</nowiki>}} → {{key press|[[=]]}}
Most markup characters also have aliases:
* {{tc|key press|pipe}} → {{key press|pipe}}
* {{tc|key press|semicolon}} → {{key press|semicolon}}
* {{tc|key press|equals}} → {{key press|equals}}
* {{tc|key press|colon}} → {{key press|colon}}
* {{tc|key press|asterisk}} → {{key press|asterisk}}
* {{tc|key press|hash}} → {{key press|hash}}
===Key symbols===
Some key names have a fitting Unicode character. This template automatically adds such "icons" to the following key names among others.
* {{tc|key press|Shift}} → {{key press|Shift}}
* {{tc|key press|Tab}} → {{key press|Tab}}
* {{tc|key press|Enter}} → {{key press|Enter}}
* {{tc|key press|Option}} → {{key press|Option}}
* {{tc|key press|Opt}} → {{key press|Opt}}
* {{tc|key press|Command}} → {{key press|Command}}
* {{tc|key press|Cmd}} → {{key press|Cmd}}
* {{tc|key press|Caps Lock}} → {{key press|Caps Lock}}
* {{tc|key press|Up}} → {{key press|Up}}
* {{tc|key press|Down}} → {{key press|Down}}
* {{tc|key press|Left}} → {{key press|Left}}
* {{tc|key press|Right}} → {{key press|Right}}
[[File:AltGr Win Menu Ctrl key.jpg|thumb|200px|Windows key and Menu key]]
[[File:Ctl wndws alt.jpg|thumb|200px|Old-style Windows key]]
There are no characters for the Windows key and Menu key. So this template shows approximate characters for them, namely the {{sc2|SQUARED PLUS}} and {{sc2|STRICTLY EQUIVALENT TO}} from the Mathematical Operators Unicode block:
* {{tc|key press|Win}} → {{key press|Win}}
* {{tc|key press|Menu}} → {{key press|Menu}}
In some cases, the automatic recognition of tokens and consequently the addition of symbols may not be desired<!-- for example in Reverse Polish notation which must distingish between plain normal Enter (without symbol) and Enter-with_automatic_duplication (with symbol) -->; in these cases the token recognition can be suppressed by HTML encoding the text, e.g. <code><nowiki>{{key press|&#x45;nter}}</nowiki></code> will give {{key press|Enter}} (plain text) instead of {{key press|Enter}} (token).
====Video games====
Video game controllers often have specialized input labels that do not map easily. The following are mappings for various game consoles and input features.
=====Directional input=====
The following should only be used when the input sequence uses something other than the primary input or mixes input between directional devices.
* {{tc|key press|l-down}} → {{key press|l-down}}
* {{tc|key press|c-left}} → {{key press|c-left}}
* {{tc|key press|r-up}} → {{key press|r-up}}
Stick specific diagonals are also supported:
* {{tc|key press|l-nw}} → {{key press|l-nw}}
* {{tc|key press|c-se}} → {{key press|c-se}}
* {{tc|key press|r-ne}} → {{key press|r-ne}}
=====PlayStation=====
* {{tc|key press|ex}} → {{key press|ex}}
* {{tc|key press|circle}} → {{key press|circle}}
* {{tc|key press|triangle}} → {{key press|triangle}}
* {{tc|key press|square}} → {{key press|square}}
{{clear}}
===TemplateData===
<templatedata>
{
"description": "Illustrates keys and keystrokes on a computer keyboard. Keys can include: Ctrl, Alt, Del, Opt, Menu, Left etc. console keys: ex, circle, triangle, square, and left right and center analog sticks: l-down, c-left, r-ne. The names are case insensitive.",
"params": {
"1": {
"label": "First key",
"description": "First key",
"type": "string/line",
"required": true
},
"2": {
"label": "Second key",
"description": "Optional key press in combination as the first.",
"type": "string/line",
"required": false
},
"3": {
"label": "Third key",
"inherits": "2"
},
"4": {
"label": "Fourth key",
"inherits": "2"
},
"5": {
"label": "Fifth key",
"inherits": "2"
},
"6": {
"label": "Sixth key",
"inherits": "2"
},
"7": {
"label": "Seventh key",
"inherits": "2"
},
"8": {
"label": "Eighth key",
"inherits": "2"
},
"9": {
"label": "Ninth key",
"inherits": "2"
},
"10": {
"label": "Tenth key",
"inherits": "2"
},
"chain": {
"label": "Chaining character",
"description": "Character between chained key presses",
"default": "+",
"inherits": "2"
},
"chain first": {
"description": "Character between first and second key to press",
"inherits": "chain"
},
"chain second": {
"description": "Character between second and third key to press",
"inherits": "chain"
},
"chain third": {
"description": "Character between third and fourth key to press",
"inherits": "chain"
},
"chain fourth": {
"description": "Character between fourth and fifth key to press",
"inherits": "chain"
}
}
}
</templatedata>
<includeonly>[[Category:Typing-aid templates]]</includeonly><noinclude></noinclude>
76b8d05aa30bbc8fa085b78f2580f8423853ec39
模块:Error/doc
828
708
1880
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
'''Module:Error''' creates an html message with class "error". It is a replacement for {{tl|error}} - please see the documentation page there for usage instructions.
d849b40dfcb982e43fd5decef12806144d0c28c2
模板:Template link with link off/doc
10
710
1882
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link general/doc]]
8e4270b5139aa35654adc31ab28bca82eaee57eb
模板:Template link expanded/doc
10
711
1883
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link general/doc]]
8e4270b5139aa35654adc31ab28bca82eaee57eb
模板:Template link expanded with subst/doc
10
712
1884
2023-03-12T07:08:59Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link general/doc]]
8e4270b5139aa35654adc31ab28bca82eaee57eb
模板:Error/doc
10
709
1881
2023-03-12T07:28:00Z
Pio
2
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
This meta template returns a ''state of error'' (recognized as such by a wiki [[Help:Parser function|parser function]]), and optionally an ''error-message text'' in red (visible for the user). It is used by other templates to signal an error, for example invalid input, which can then either be displayed to the editor or caught and handled by other templates.
== Usage ==
* {{tlx|error|An exemplary error}} → {{error|An exemplary error}}
* {{tlx|error|message{{=}}An exemplary error}} → {{error|message=An exemplary error}}
* Compare, used in a Parser Function: <code><nowiki>{{#expr:Foo}}</nowiki></code> → {{#expr:Foo}}
* <code><nowiki>{{#iferror:{{error|Foo}} | {{y}} | {{n}} }}</nowiki></code> → {{#iferror:{{error|Foo}} | {{y}} | {{n}} }}
=== Tag option ===
The tag to contain the error message can be given through the <code>tag</code> parameter, but it will only accept <code>span</code>, <code>div</code>, <code>p</code>, and <code>strong</code>, since those are the only tags recognized by the {{pf|iferror}} parser function. It defaults to <code>strong</code>, the tag generated e.g. by {{pf|expr}}. To prevent <code>strong</code> message, use one of the other tags, e.g. <code>tag=span</code>.
* ABC {{tlx|error|An exemplary error demo no tag (default)}} XYZ → ABC {{error|An exemplary error demo no tag (default)}} XYZ
* ABC {{tlx|error|An exemplary error demo span|tag{{=}}span}} XYZ → ABC {{error|An exemplary error demo span|tag=span}} XYZ
* ABC {{tlx|error|An exemplary error demo div|tag{{=}}div}} XYZ → ABC {{error|An exemplary error demo div|tag=div}} XYZ
* ABC {{tlx|error|An exemplary error demo p|tag{{=}}p}} XYZ → ABC {{error|An exemplary error demo p|tag=p}} XYZ
* ABC {{tlx|error|An exemplary error demo strong|tag{{=}}strong}} XYZ → ABC {{error|An exemplary error demo strong|tag=strong}} XYZ
==TemplateData==
<TemplateData>
{
"description": "The template returns a state of error (recognized as such by a wiki parser function), and optionally an error-message text in red (visible for the user)",
"params": {
"1": {
"label": "Message",
"description": "Error message text in red",
"type": "string",
"required": false,
"suggested": true
},
"tag": {
"label": "Tag",
"description": "The tag to contain the error message; will only accept span, div, p, and strong, since those are the only tags recognized by the #iferror parser function. It defaults to strong, the tag generated e.g. by #expre",
"type": "string",
"default": "strong",
"required": false
}
}
}
</TemplateData>
<noinclude>
<!-- Categories below this line, please; interwikis at Wikidata -->
</noinclude>
635292eb5fc4fabe041607121f1ccc551660f0ff
模板:WP/doc
10
716
1888
2023-03-12T07:34:51Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
;Description
:This template is used to reference Wikipedia pages quickly
;Syntax
:Type <code>{{t|WP|Wikipedia Article Name}}</code>
;Sample output
:<code><nowiki>{{WP|Tapir}}</nowiki></code> gives:
:{{WP|Tapir}}
:<code><nowiki>{{WP|text=Bartti the Tapir|Bartti_the_Tapir}}</nowiki></code> gives:
:{{WP|text=Bartti the Tapir|Bartti_the_Tapir}}
:<code><nowiki>{{WP|ref=no|Tapir}}</nowiki></code> gives:
:{{WP|ref=no|Tapir}}
:<code><nowiki>{{WP|ref=no|text=Bartti the Tapir|Bartti_the_Tapir}}</nowiki></code> gives:
:{{WP|ref=no|text=Bartti the Tapir|Bartti_the_Tapir}}
;Refrences
<references/>
3994942d2cca430498f57e905789205e0601e6e0
模板:Template link code/doc
10
720
1892
2023-03-12T07:46:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Template link general/doc]]
8e4270b5139aa35654adc31ab28bca82eaee57eb
模板:Legend/doc
10
722
1894
2023-03-12T07:57:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{t|Legend}} shows a legend row with a colored box.
==Usage==
<nowiki>{{</nowiki>legend|''background-color''|''caption''|outline=''outline color''|border=''css border''<nowiki>}}</nowiki>
*''background-color'' is passed to the [[Cascading Style Sheets|css]] background-color property of the color box.
*The optional ''outline'' parameter is the color of the outline around the box.
*The optional ''border'' argument which overrides the ''outline'' argument and sets the css description (e.g., <code>1px solid #aaa</code>) of the border that will be drawn around the box. Yes
==Examples==
===Use in text===
<nowiki>{{legend|black|Africa}}</nowiki>
<nowiki>{{legend|green|Americas}}</nowiki>
<nowiki>{{legend|blue|Oceania}}</nowiki>
<nowiki>{{legend|#ffa|Europe|outline=silver}}</nowiki>
<nowiki>{{legend|#ff2800|Asia|outline=#A2A9B1}}</nowiki> <small><span style="color:gray">''(#A2A9B1 is the [[Help:Basic table markup|wikitables]] border color.)''</span></small>
{{legend|black|Africa}}
{{legend|green|Americas}}
{{legend|blue|Oceania}}
{{legend|#ffa|Europe|outline=silver}}
{{legend|#ff2800|Asia|outline=#A2A9B1}}
===Use in captions===
<div style="display:flex">
<pre><nowiki>
[[File:Celts in Europe.png|upright=.9|thumb|right|The Celts in Europe, past and present:
{{legend|#1a8000|Present-day Celtic-speaking areas}}
{{legend|#27c600|Other parts of the six most commonly recognized "Celtic nations" and where a Celtic language is spoken but not the dominating language}}
{{legend|#97ffb6|Other parts of Europe once peopled by Celts; modern-day inhabitants of many of these areas often claim a Celtic heritage and/or culture}}
{{legend|#D2FFD2|Lusitanian area of Iberia, "Celticity" uncertain}}
{{legend|yellow|The core Hallstatt territory, expansion before 500 BC}}
]]
</nowiki></pre>
[[File:Celts in Europe.png|upright=.9|thumb|right|The Celts in Europe, past and present:
{{legend|#1a8000|Present-day Celtic-speaking areas}}
{{legend|#27c600|Other parts of the six most commonly recognized "Celtic nations" and where a Celtic language is spoken but not the dominating language}}
{{legend|#97ffb6|Other parts of Europe once peopled by Celts; modern-day inhabitants of many of these areas often claim a Celtic heritage and/or culture}}
{{legend|#D2FFD2|Lusitanian area of Iberia, "Celticity" uncertain}}
{{legend|yellow|The core Hallstatt territory, expansion before 500 BC}}]]
</div>
==Full parameter list==
<pre>
{{legend
| [legend box's color]
| [text following legend box]
| outline = <!--colo(u)r of border around legend box-->
| border = <!--use to specify custom CSS styling for border (overrides 'outline')-->
| color = <!--colo(u)r of 'text'-->
| size = <!--'text' font-size-->
| text = <!--to place text inside the legend box-->
}}
</pre>
==TemplateData==
<templatedata>
{
"params": {
"1": {
"label": "Color",
"description": "The color for the legend entry, in any CSS format",
"example": "\"#6D6E00\", \"#ffa\", \"yellow\"",
"type": "line",
"required": true
},
"2": {
"label": "Caption",
"description": "Label for the legend entry",
"example": "\"soda\" is most common",
"type": "string",
"suggested": true
},
"border": {
"label": "CSS border style",
"description": "CSS style for the legend entry's border",
"type": "string"
},
"outline": {
"label": "Entry outline",
"description": "CSS color for the outline of the legend entry",
"example": "silver",
"type": "line"
},
"text": {
"label": "Text in the entry",
"description": "Text to be displayed in the legend entry box, i.e. within the color specified",
"example": "Af",
"type": "line"
},
"textcolor": {
"label": "Text color",
"description": "CSS color of text inside the legend's colored box",
"type": "string"
},
"size": {
"description": "Font size of the legend entry, including colored box",
"type": "string"
}
},
"description": "Shows a legend row with a colored box and a caption."
}
</templatedata>
2782c417ebe56148322c5bcd4f8d86d8df0563ad
模板:Start date and age/doc
10
723
1895
2023-03-12T07:57:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{tsh|SDA}}
The '''{{t|Start date and age}}''' template displays the date that an event or entity started or was created. It is also modified to '''calculate lore time''' in [[Star Citizen]]. It also includes a duplicate, machine-readable date in the {{WP|ref=no|ISO_8601|text=ISO 8601}} format (which is hidden by {{WP|ref=no|CSS}}), for use inside other templates which emit {{WP|ref=no|microformat|text=microformats}}. The hidden date degrades gracefully when CSS is not available.
== Usage ==
;Common usage
: <code><nowiki>{{Start date and age|yyyy|mm|dd}}</nowiki></code> to display formatted as:
: {{xt|{{Start date and age|2010|03|25}}}}
: <code><nowiki>{{Start date and age|yyyy|mm|dd|df=yes}}</nowiki></code> to display formatted as:
: {{xt|{{Start date and age|2010|03|25|df=yes}}}}
;Displayling in Star Citizen time
: <code><nowiki>{{Start date and age|yyyy|mm|dd|sctime=yes}}</nowiki></code> to display formatted as:
: {{xt|{{Start date and age|2772|03|25|sctime=yes}}}}
;Full syntax
: <code><nowiki>{{Start date and age|yyyy|mm|dd|df=yes|p=yes|br=yes}}</nowiki></code> to display formatted as:
: {{xt|{{Start date and age|2010|03|25|df=yes|p=yes|br=yes}}}}
== Parameters ==
{| class="wikitable"
! Parameter
! Status
! Description
|-
| 1
| required
| A four-digit number indicating the year.
|-
| 2
| optional
| A number between 1 and 12 indicating the month (leading zeros in the number are ignored). The month may also be specified as a name or abbreviation (e.g. "August" or "Aug").
|-
| 3
| optional
| A number between 1 and 31 indicating the day of the month (leading zeros in the number are ignored).
|-
| sctime=
| optional
| If the parameter '''sctime''' equals '''yes''', '''y''', or '''1''', the current Star Citizen in-universe time will be used.
|-
| df=
| optional
| If the parameter '''df''' equals '''yes''', '''y''', or '''1''', the date will be displayed in DMY format: {{xt|4 March 2010}}. When this parameter is not included or set to some other value, the date will be displayed in MDY format: {{xt|March 4, 2010}}.
|-
| p=<br/>paren=
| optional
| If the parameter '''p''' or '''paren''' equals '''yes''', '''y''', or '''1''', the age will be displayed within parentheses. When this parameter is not included or set to some other value, the date and age are separated by a semicolon and a breaking space.
|-
| br=
| optional
| If the parameter '''br''' equals '''yes''', '''y''', or '''1''', a line break will be inserted between the date and the age. When this parameter is not included or set to some other value, a breaking space will be inserted between the date and the age. This does not change the separating characters between the date and age which are either a semicolon (default setting) or parentheses (if '''p=yes''').
|}
==="df" (day first) and "mf" (month first)===
The default output of this template is to display the month before the day (MDY). This default may not be appropriate for articles about events or entities in parts of the world where dates are commonly given with the day preceding the month (DMY). To display the day first, assign the '''df''' parameter a value of '''yes''', '''y''', or '''1''' (e.g. '''df=yes''').
If the default format is preferred, the parameter '''df''' may be used with value of '''no''', '''n''', or '''0''' (e.g. '''df=no'''). These values can assist bots or other automated processing to detect the intended date format; omitting the '''df''' parameter may lead an editor or bot to change the format to an unintended value.
The preference to display the month first may also be indicated via the parameter '''mf''' (e.g. '''mf=yes'''). While not actually used by the template, this is another method of indicating that the default format is intended. Do not specify both "df" and "mf" parameters in the same use of the template.
== Examples ==
=== Default separator: semicolon ===
{| class="wikitable" style="width:100%;"
! style="width:60%;" | Syntax
! style="width:40%;" | Result
|-
|colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)'''
|-
| <code><nowiki>{{Start date and age|2010|01|02}}</nowiki></code>
| {{Start date and age|2010|01|02}}
|-
| <code><nowiki>{{Start date and age|2008|Jan|09|df=no}}</nowiki></code>
| {{Start date and age|2008|Jan|09|df=no}}
|-
| <code><nowiki>{{Start date and age|2003|January|05|mf=yes}}</nowiki></code>
| {{Start date and age|2003|January|05|mf=yes}}
|-
| <code><nowiki>{{Start date and age|2010|1|2|df=yes}}</nowiki></code>
| {{Start date and age|2010|1|2|df=yes}}
|-
| <code><nowiki>{{Start date and age|2008|Jan|9|df=y}}</nowiki></code>
| {{Start date and age|2008|Jan|9|df=y}}
|-
| <code><nowiki>{{Start date and age|2003|January|5|df=1}}</nowiki></code>
| {{Start date and age|2003|January|5|df=1}}
|-
| 100 days ago:<br /><code><nowiki>{{Start date and age|</nowiki>{{#time:Y|now-100 days}}|{{#time:n|now-100 days}}|{{#time:j|now-100 days}}}}</code>
| {{Start date and age|{{#time:Y|now-100 days}}|{{#time:n|now-100 days}}|{{#time:j|now-100 days}}}}
|-
| Yesterday:<br /><code><nowiki>{{Start date and age|</nowiki>{{#time:Y|now-1 days}}|{{#time:n|now-1 days}}|{{#time:j|now-1 days}}}}</code>
| {{Start date and age|{{#time:Y|now-1 days}}|{{#time:n|now-1 days}}|{{#time:j|now-1 days}}}}
|-
| Today:<br /><code><nowiki>{{Start date and age|</nowiki>{{#time:Y|now}}|{{#time:n|now}}|{{#time:j|now}}}}</code>
| {{Start date and age|{{#time:Y|now}}|{{#time:n|now}}|{{#time:j|now}}}}
|-
|colspan="2" style="background-color:#DDD" | '''Year and month'''
|-
| <code><nowiki>{{Start date and age|2001|9}}</nowiki></code>
| {{Start date and age|2001|9}}
|-
| <code><nowiki>{{Start date and age|2002|09}}</nowiki></code>
| {{Start date and age|2002|09}}
|-
| <code><nowiki>{{Start date and age|2003|Sep}}</nowiki></code>
| {{Start date and age|2003|Sep}}
|-
| <code><nowiki>{{Start date and age|2004|September}}</nowiki></code>
| {{Start date and age|2004|September}}
|-
|colspan="2" style="background-color:#DDD" | '''Year only'''
|-
| <code><nowiki>{{Start date and age|2005}}</nowiki></code>
| {{Start date and age|2005}}
|}
=== Optional separator: parentheses ===
{| class="wikitable" style="width:100%;"
! style="width:60%;" | Syntax
! style="width:40%;" | Result
|-
|colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)'''
|-
| <code><nowiki>{{Start date and age|2003|02|15|p=yes}}</nowiki></code>
| {{Start date and age|2003|02|15|p=yes}}
|-
| <code><nowiki>{{Start date and age|2003|02|15|df=y|p=y}}</nowiki></code>
| {{Start date and age|2003|02|15|df=y|p=yes}}
|-
|colspan="2" style="background-color:#DDD" | '''Year and month'''
|-
| <code><nowiki>{{Start date and age|2003|02|p=1}}</nowiki></code>
| {{Start date and age|2003|02|p=1}}
|-
|colspan="2" style="background-color:#DDD" | '''Year only'''
|-
| <code><nowiki>{{Start date and age|2003|paren=yes}}</nowiki></code>
| {{Start date and age|2003|paren=yes}}
|}
=== Line break with semicolon ===
{| class="wikitable" style="width:100%;"
! style="width:60%;" | Syntax
! style="width:40%;" | Result
|-
|colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)'''
|-
| <code><nowiki>{{Start date and age|2003|02|15|br=yes}}</nowiki></code>
| {{Start date and age|2003|02|15|br=yes}}
|-
| <code><nowiki>{{Start date and age|2003|02|15|df=y|br=y}}</nowiki></code>
| {{Start date and age|2003|02|15|df=y|br=y}}
|-
|colspan="2" style="background-color:#DDD" | '''Year and month'''
|-
| <code><nowiki>{{Start date and age|2003|02|br=1}}</nowiki></code>
| {{Start date and age|2003|02|br=1}}
|-
|colspan="2" style="background-color:#DDD" | '''Year only'''
|-
| <code><nowiki>{{Start date and age|2003|br=yes}}</nowiki></code>
| {{Start date and age|2003|br=yes}}
|}
=== Line break with parentheses ===
{| class="wikitable" style="width:100%;"
! style="width:60%;" | Syntax
! style="width:40%;" | Result
|-
|colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)'''
|-
| <code><nowiki>{{Start date and age|2003|02|15|p=yes|br=yes}}</nowiki></code>
| {{Start date and age|2003|02|15|p=yes|br=yes}}
|-
| <code><nowiki>{{Start date and age|2003|02|15|df=y|p=y|br=y}}</nowiki></code>
| {{Start date and age|2003|02|15|df=y|p=y|br=y}}
|-
|colspan="2" style="background-color:#DDD" | '''Year and month'''
|-
| <code><nowiki>{{Start date and age|2003|02|p=1|br=1}}</nowiki></code>
| {{Start date and age|2003|02|p=1|br=1}}
|-
|colspan="2" style="background-color:#DDD" | '''Year only'''
|-
| <code><nowiki>{{Start date and age|2003|paren=yes|br=yes}}</nowiki></code>
| {{Start date and age|2003|paren=yes|br=yes}}
|}
== Supporting templates ==
* [[Template:MONTHNAME]] – display name of month for a given number 1 (January) through 12 (December).
* [[Template:Time ago]] – display number of days, months, or years ago (for dates given as <code><nowiki>|yyyy|mm|dd</nowiki></code>).
* [[Template:Years or months ago]] – display number of months or years ago (for dates given as <code><nowiki>|yyyy|mm</nowiki></code> or <code><nowiki>|yyyy</nowiki></code>).
* [[Template:Yesno]] – allows optional formatting parameters to accept values other than "yes" (such as "y" or "1").
==TemplateData ==
<templatedata>
{
"params": {
"1": {
"label": "Year",
"description": "A four-digit number indicating the year",
"example": "2017",
"type": "number",
"required": true
},
"2": {
"label": "Month",
"description": "A number between 1 and 12 indicating the month",
"example": "12",
"type": "number",
"suggested": true
},
"3": {
"label": "Day",
"description": "A number between 1 and 31 indicating the day of the month",
"example": "31",
"type": "number",
"suggested": true
},
"sctime": {
"label": "Lore time",
"description": "If the parameter df equals yes, y, or 1, the template will use lore time instead of real life time.",
"example": "yes",
"type": "boolean",
"default": "no"
},
"df": {
"label": "Display date first",
"description": "If the parameter df equals yes, y, or 1, the date will be displayed in DMY format: 4 March 2010. When this parameter is not included or set to some other value, the date will be displayed in MDY format: March 4, 2010.",
"example": "no",
"type": "boolean",
"default": "no"
},
"paren": {
"aliases": [
"p"
],
"label": "Display with parentheses",
"description": "If the parameter p or paren equals yes, y, or 1, the age will be displayed within parentheses. When this parameter is not included or set to some other value, the date and age are separated by a semicolon and a breaking space.",
"example": "yes",
"type": "boolean",
"default": "no"
},
"br": {
"label": "Line break between date and age",
"description": "If the parameter br equals yes, y, or 1, a line break will be inserted between the date and the age. When this parameter is not included or set to some other value, a breaking space will be inserted between the date and the age. This does not change the separating characters between the date and age which are either a semicolon (default setting) or parentheses (if paren=yes).",
"example": "yes",
"type": "boolean",
"default": "no"
},
"end": {
"label": "Use microformat for end date",
"description": "This template includes hidden microformat <span class=\"bday dtstart published updated\">, similar to Template:Start date. If the parameter end equals yes, y, or 1, the template will instead use <span class=\"dtend\">, similar to Template:End date. This parameter is used by Template:End date and age. For more details, see Wikipedia:WikiProject Microformats.",
"example": "yes",
"type": "boolean",
"default": "no"
}
},
"description": "The Start date and age template displays the date that an event or entity started or was created."
}
</templatedata>
<includeonly>[[Category:Mathematical function templates]]</includeonly><noinclude></noinclude>
db8939a0acec561434d41f7760f6563d6ce90f31
模板:Unbulleted list/doc
10
724
1896
2023-03-12T07:57:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Template shortcut|ubl|ubt|ublist|unbullet}}
{{Wikipedia template}}
{{t|Unbulleted list}} creates unbulleted lists. Each item in the list may have CSS styles added to it individually, by appending a numbered parameter.
== Usage ==
; Basic usage
{{pre2|<nowiki>{{</nowiki>unbulleted list<nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>...<nowiki>}}</nowiki>}}
; All parameters
{{pre2|
<nowiki>{{</nowiki>unbulleted list
<nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>...
<nowiki>|class = </nowiki>''class''
<nowiki>|style = </nowiki>''style''
<nowiki>|list_style = </nowiki>''style for ul tag''
<nowiki>|item_style = </nowiki>''style for all li tags''
<nowiki>|item1_style = </nowiki>''style for first li tag''<nowiki> |item2_style = </nowiki>''style for second li tag''<nowiki> |</nowiki>...
<nowiki>}}</nowiki>
}}
=== Parameters ===
* Positional parameters (<code>1</code>, <code>2</code>, <code>3</code>...) – these are the list items. If no list items are present, the module will output nothing.
* <code>class</code> – a custom class for the {{tag|div}} tags surrounding the list, e.g. <code>plainlinks</code>.
* <code>style</code> – a custom CSS style for the {{tag|div}} tags surrounding the list, e.g. <code>font-size: 90%;</code>.
* <code>list_style</code> – a custom CSS style for the {{tag|ul}} tags around the list. The format is the same as for the {{para|style}} parameter.
* <code>item_style</code> – a custom CSS style for all of the list items (the {{tag|li}} tags). The format is the same as for the {{para|style}} parameter.
* <code>item1_style</code>, <code>item2_style</code>, <code>item3_style</code>... – custom CSS styles for each of the list items. The format is the same as for the {{para|style}} parameter.
=== Example ===
{| class="wikitable"
! style="width: 80%;" | Code !! Result
|-
| <code><nowiki>{{Unbulleted list|entry1|entry2|entry3|entry4|entry5</nowiki>{{wbr}}<nowiki>|entry6|entry7|entry8|entry9}}</nowiki></code>
| {{Unbulleted list|entry1|entry2|entry3|entry4|entry5|entry6|entry7|entry8|entry9}}
|-
| <code><nowiki>{{Unbulleted list|Winner|Runner-up|Third place|item_style=color:blue;}}</nowiki></code>
| {{Unbulleted list|Winner|Runner-up|Third place|item_style=color:blue;}}
|-
| <code><nowiki>{{Unbulleted list|Winner|Runner-up|Third place|item1_style=background-color:yellow;|item2_style=background-color:silver;}}</nowiki></code>
| {{Unbulleted list|Winner|Runner-up|Third place|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
|}
=== Controlling line-breaking ===
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists, to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== See also ==
* {{tl|plainlist}}
* {{tl|flatlist}} and {{tl|hlist}}
* {{tl|ordered list}} and {{tl|unordered list}}
* {{tl|nowrap}}
* {{tl|pagelist}}
<includeonly>
[[Category:Formatting and function templates]]
</includeonly>
<noinclude></noinclude>
e7d9a994a5d46386b7e9e9e44e6a69ae0bfd6889
模板:Spaces/doc
10
725
1897
2023-03-12T07:57:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Template shortcut| |nbs|nbsp|nbsp;|space|spcs}}
{{Wikipedia template}}
A template to produce one or more [[Wikipedia:non-breaking space|non-breaking space]]s (<code>&nbsp;</code> character entities).
== Usage ==
; Syntax : <code><nowiki>{{spaces|</nowiki>''N''{{!}}''type''}}</code> ...... to produce ''N'' consecutive non-breaking spaces (where ''N'' is a whole number larger than zero) of the type specified by the second parameter: <code>em</code>, <code>en</code>, <code>fig</code>, <code>hair</code>, <code>thin</code>, or if not specified, a non-breaking space (<source inline lang=xml> </source>) the same width as a standard space.
<code><nowiki>{{space|</nowiki>''type''<nowiki>}}</nowiki></code> produces a single non-breaking space of the type indicated.
=== Controlling line-breaking in infoboxes ===
This template, usually as its alias {{tlx|nbsp}}, may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists in infoboxes, to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== TemplateData ==
<templatedata>
{
"description": "Inserts one or more non-breaking spaces",
"params": {
"1": {
"label": "Quantity",
"description": "How many non-breaking spaces to insert",
"type": "number",
"default": "1"
},
"2": {
"label": "Type",
"description": "Non-default types (in decreasing order of width): em, fig, en, thin, hair",
"type": "string",
"default": " "
}
}
}
</templatedata>
<includeonly>
[[Category:Formatting and function templates]]
</includeonly>
<noinclude></noinclude>
d38de8c6b563905259fe3d5a2c86a3f3feb3d5ea
模板:Void/doc
10
726
1898
2023-03-12T07:57:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{tsh|^|Nul|Null}}
{{Wikipedia template}}
This template does nothing—more precisely, it throws away its parameters and outputs the null string.
It is useful for programming advanced templates, and is often used within a template to the right of an equals sign. It may also be used in a template to disambiguate parsing of braces.
It can also be used to temporarily disable code, and unlike "commenting out" with <code><nowiki><!-- --></nowiki></code>, it nests. This means that <code><nowiki>{{void|foo {{void|bar}} baz}}</nowiki></code> is valid, whereas <code><nowiki><!-- foo <!-- bar --> baz --></nowiki></code> will produce <code><!-- foo <!-- bar --> baz --></code>.
Another possible application would be to temporarily disable an infobox on an article page while a problem with the infobox template itself is resolved.
==Alternatives==
{{Tl|Null}} redirects here. It's also possible to use <code><nowiki>{{ns:0}}</nowiki></code>, the empty/void/null string for the main namespace.
It can be used in place of <code><nowiki><nowiki/></nowiki></code> to break character sequence parsing, for example <code><nowiki>{{nowrap|{''a''}{{null}}}}</nowiki></code> to force the first closing brace to be treated as part of the template parameter instead of as the end of the template expression.
<includeonly>[[Category:Formatting and function templates]]</includeonly>
82529dab61e205f9d1c047340c2712cfa5cc0f39
模板:Namespace detect/doc
10
727
1899
2023-03-12T07:57:11Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{Wikipedia template}}
{{t|Namespace detect}} helps other templates detect what type of page they are on.
<includeonly>
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Utility templates]]
</includeonly>
af48a567d44a005cc505299a707571bc86536fbc
模板:Legend/styles.css
10
728
1900
2023-03-12T07:58:17Z
Pio
2
创建空白页面
sanitized-css
text/css
da39a3ee5e6b4b0d3255bfef95601890afd80709
模板:Xt
10
729
1901
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{FormattingError|[[:{{#invoke:TEMPLATENAME|main}}]] is only for examples of style and formatting. Do not use it in actual articles.}}|<span class="example good-example" style="font-family: Georgia, 'DejaVu Serif', serif; color: #006400;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span>}}<noinclude>{{/doc}}</noinclude>
1f0db55ed7696eb385eee4061df9ba8427779334
模板:MONTHNAME
10
730
1902
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}|{{#switch:{{MONTHNUMBER|{{{1}}}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=''month''!}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>{{/doc}}</noinclude>
2c498ff07977067599677b244c8a9fba66b42928
模板:Time ago
10
731
1903
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{#invoke:Time ago|main}}<noinclude>{{/doc}}</noinclude>
e8c4a26b0d1afeb3d2c15dec6b579e5bfa2db894
模板:Years or months ago
10
732
1904
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<includeonly>{{#ifexpr:{{#if:{{{2|}}}|1|0}}=0 or abs( ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12)) >= 12
|<!-- in years -->{{#expr:floor(abs( ( ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) ) / 12 ))}} {{#ifexpr:({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) < 0
|<!-- future -->{{#ifexpr:floor( ( ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) ) / 12 ) = -1|year's|years'}}
|<!-- past/current -->{{#ifexpr:floor( ( ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) ) / 12 ) = 1|year|years}}
}}
|<!-- in months -->{{#expr:abs( ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) )}} {{#ifexpr:({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) < 0
|<!-- future -->{{#ifexpr: ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) = -1|month's|months'}}
|<!-- past/current -->{{#ifexpr: ({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) = 1|month|months}}
}}
}} {{#ifexpr:({{{4|{{CURRENTMONTH}}}}}+{{{3|{{CURRENTYEAR}}}}}*12) - ({{{2|{{CURRENTMONTH}}}}}+{{{1|{{CURRENTYEAR}}}}}*12) < 0|time|ago}}</includeonly><noinclude>{{/doc}}</noinclude>
00235e91de457c892464964e586a5628828f60d5
模板:Yesno
10
733
1905
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|false
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|true
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>{{/doc}}</noinclude>
7c8b643bb131c448220db73d9df137b2d3b2c104
模板:MONTHNAME/doc
10
734
1906
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
This template returns the name of the month whose number is in parameter. Alternatively, the English month name or abbreviation (with any letter case) can be given.
; Syntax<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|</nowiki></tt>''month''<tt>}}</tt>
* The ''month'' value is interpreted modulo 12 (extra leading zeroes and decimals are ignored).
; Compatibility synonym<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>month name|</tt>''month''<tt>}}</tt>
; Examples for all standard month numbers<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|1}}</nowiki></tt> returns {{MONTHNAME|1}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|2}}</nowiki></tt> returns {{MONTHNAME|2}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|3}}</nowiki></tt> returns {{MONTHNAME|3}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|4}}</nowiki></tt> returns {{MONTHNAME|4}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|5}}</nowiki></tt> returns {{MONTHNAME|5}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|6}}</nowiki></tt> returns {{MONTHNAME|6}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|7}}</nowiki></tt> returns {{MONTHNAME|7}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|8}}</nowiki></tt> returns {{MONTHNAME|8}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|9}}</nowiki></tt> returns {{MONTHNAME|9}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|10}}</nowiki></tt> returns {{MONTHNAME|10}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|11}}</nowiki></tt> returns {{MONTHNAME|11}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|12}}</nowiki></tt> returns {{MONTHNAME|12}}
; Examples for month numbers with extra leading zero<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|01}}</nowiki></tt> returns {{MONTHNAME|01}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|02}}</nowiki></tt> returns {{MONTHNAME|02}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|03}}</nowiki></tt> returns {{MONTHNAME|03}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|04}}</nowiki></tt> returns {{MONTHNAME|04}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|05}}</nowiki></tt> returns {{MONTHNAME|05}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|06}}</nowiki></tt> returns {{MONTHNAME|06}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|07}}</nowiki></tt> returns {{MONTHNAME|07}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|08}}</nowiki></tt> returns {{MONTHNAME|08}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|09}}</nowiki></tt> returns {{MONTHNAME|09}}
; Examples for month number cyclic underflows and overflows, from computed values<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-12}}</nowiki></tt> returns {{MONTHNAME|-12}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-11}}</nowiki></tt> returns {{MONTHNAME|-11}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-10}}</nowiki></tt> returns {{MONTHNAME|-10}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-9}}</nowiki></tt> returns {{MONTHNAME|-9}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-3}}</nowiki></tt> returns {{MONTHNAME|-3}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-2}}</nowiki></tt> returns {{MONTHNAME|-2}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|-1}}</nowiki></tt> returns {{MONTHNAME|-1}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|0}}</nowiki></tt> returns {{MONTHNAME|0}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|13}}</nowiki></tt> returns {{MONTHNAME|13}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|14}}</nowiki></tt> returns {{MONTHNAME|14}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|15}}</nowiki></tt> returns {{MONTHNAME|15}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|16}}</nowiki></tt> returns {{MONTHNAME|16}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|23}}</nowiki></tt> returns {{MONTHNAME|23}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|24}}</nowiki></tt> returns {{MONTHNAME|24}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|25}}</nowiki></tt> returns {{MONTHNAME|25}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|1200}}</nowiki></tt> returns {{MONTHNAME|1200}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|1201}}</nowiki></tt> returns {{MONTHNAME|1201}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|1212}}</nowiki></tt> returns {{MONTHNAME|1212}}
; Examples for all standard English month names<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|JANUARY}}</nowiki></tt> returns {{MONTHNAME|JANUARY}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|FEBRUARY}}</nowiki></tt> returns {{MONTHNAME|FEBRUARY}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|MARCH}}</nowiki></tt> returns {{MONTHNAME|MARCH}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|APRIL}}</nowiki></tt> returns {{MONTHNAME|APRIL}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|MAY}}</nowiki></tt> returns {{MONTHNAME|MAY}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|JUNE}}</nowiki></tt> returns {{MONTHNAME|JUNE}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|JULY}}</nowiki></tt> returns {{MONTHNAME|JULY}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|AUGUST}}</nowiki></tt> returns {{MONTHNAME|AUGUST}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|SEPTEMBER}}</nowiki></tt> returns {{MONTHNAME|SEPTEMBER}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|OCTOBER}}</nowiki></tt> returns {{MONTHNAME|OCTOBER}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|NOVEMBER}}</nowiki></tt> returns {{MONTHNAME|NOVEMBER}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|DECEMBER}}</nowiki></tt> returns {{MONTHNAME|DECEMBER}}
; Examples for all abbreviated English month names<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|jan}}</nowiki></tt> returns {{MONTHNAME|jan}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|feb}}</nowiki></tt> returns {{MONTHNAME|feb}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|mar}}</nowiki></tt> returns {{MONTHNAME|mar}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|apr}}</nowiki></tt> returns {{MONTHNAME|apr}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|may}}</nowiki></tt> returns {{MONTHNAME|may}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|jun}}</nowiki></tt> returns {{MONTHNAME|jun}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|jul}}</nowiki></tt> returns {{MONTHNAME|jul}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|aug}}</nowiki></tt> returns {{MONTHNAME|aug}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|sep}}</nowiki></tt> returns {{MONTHNAME|sep}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|oct}}</nowiki></tt> returns {{MONTHNAME|oct}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|nov}}</nowiki></tt> returns {{MONTHNAME|nov}}
: <tt><nowiki>{{</nowiki>MONTHNAME<nowiki>|dec}}</nowiki></tt> returns {{MONTHNAME|dec}}
<includeonly>[[Category:Mathematical function templates]]</includeonly><noinclude></noinclude>
647ba9fb80df73b1b66226d889f94fe1134c879d
模板:Time ago/doc
10
735
1907
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
The '''Time ago''' template calculates the amount of time which has passed since a provided timestamp. The result is a string similar to one of the examples below. This template ''should not'' be used with "subst" unless you don't want the stamp to change as the user refreshes the page.
The result is rounded down. "Month" is defined as 31 days.
;Usage
* <code><nowiki>{{</nowiki>'''Time ago'''|''timestamp''<nowiki>}}</nowiki></code>
The timestamp can be almost any solid, readable format but to avoid ambiguity mistakes, one of the styles below is preferred.
* <code>magnitude</code> parameter can be set to explicitly use certain unit. Allowed values are: <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>weeks</code>, <code>months</code> and <code>years</code>.
* <code>min_magnitude</code> parameter can be set to use the specified unit or bigger units. Allowed values are: <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>months</code> and <code>years</code>.
* <code>ago</code> parameter can be set to override the default usage of the text "<code>ago</code>".
;Examples
* <tt><nowiki>{{Time ago| -83 minutes}}</nowiki></tt> → '''{{Time ago|-83 minutes}}'''
* <tt><nowiki>{{Time ago| -334 minutes}}</nowiki></tt> → '''{{Time ago|-334 minutes}}'''
* <tt><nowiki>{{Time ago|{{REVISIONTIMESTAMP}}}}</nowiki></tt> → '''{{Time ago|{{REVISIONTIMESTAMP}}}}'''
* <tt><nowiki>{{Time ago| Jan 21, 2001 3:45 PM}}</nowiki></tt> → '''{{Time ago|Jan 21 2001 3:45 PM}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008}}</nowiki></tt> → '''{{Time ago|Nov 6 2008}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008|magnitude=weeks}}</nowiki></tt> → '''{{Time ago| Nov 6 2008|magnitude=weeks}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008|min_magnitude=days}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|min_magnitude=days}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008|min_magnitude=years}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|min_magnitude=years}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008|ago=in the past}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|ago=in the past}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008|purge=yes}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|purge=yes}}'''
* <tt><nowiki>{{Time ago| Nov 6 2008|purge=x}}</nowiki></tt> → '''{{Time ago|Nov 6 2008|purge=x}}'''
<includeonly>[[Category:Mathematical function templates]]</includeonly><noinclude></noinclude>
b0ca078698e5fb2ddd6fc5852f3008d28135d680
模板:Years or months ago/doc
10
736
1908
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
'''Template:Years or months ago''' displays the number of years (or months if less than 1 year) between a specified year/month date and the current year/month. It will also work correctly when only the year is given. Optionally, a second year/month date can be specified to be used instead of the current year/month.
This was designed as a supporting template for '''[[Template:Start date and age]]''', to be used when the specified date does not include the day of the month. The formatting of the output was designed to be similar to '''[[Template:Time ago]]'''.
== Usage ==
For years or months before or after current date:
* <code><nowiki>{{</nowiki>Years or months ago|''year''|''month''}}</code>
* <code><nowiki>{{</nowiki>Years or months ago|''year''}}</code>
For years or months between two dates:
* <code><nowiki>{{</nowiki>Years or months ago|''year1''|''month1''|''year2''|''month2''}}</code>
<includeonly>[[Category:Mathematical function templates]]</includeonly><noinclude></noinclude>
d49c0c236e82d6b8008d1bb2706175392a6db712
模板:Yesno/doc
10
737
1909
2023-03-12T08:05:16Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
This template normalises an input to be a yes/no output.
=== Usage ===
The template has five possible outputs depending on the default parameter (input if you will).
In its simplest usage these will all be either "yes" or "" (blank - nothing no characters).
# <tt><nowiki>{{yesno|yes}}</nowiki></tt> result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
# <tt><nowiki>{{yesno|no}}</nowiki></tt> result "" (also applies to "No", "NO", "nO", "N", "n" and "0")
# <tt><nowiki>{{yesno}}</nowiki></tt> result ""
# <tt><nowiki>{{yesno|¬}}</nowiki></tt> result ""
# <tt><nowiki>{{yesno|purplemonkeydishwasher}}</nowiki></tt> result "yes" (also applies to any other value not given above).
Each of these can be over-ridden.
# <tt><nowiki>{{yesno|yes|yes=bacon}}</nowiki></tt> result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
# <tt><nowiki>{{yesno|no|no=ham}}</nowiki></tt> result "ham" (also applies to "No", "NO", "nO", "N", "n" and "0")
# <tt><nowiki>{{yesno|blank= eggs}}</nowiki></tt> result "eggs"
## but <tt><nowiki>{{yesno|no=ham}}</nowiki></tt> result "ham"
## and <tt><nowiki>{{yesno|blank= eggs|no=ham}}</nowiki></tt> result "eggs"
# <tt><nowiki>{{yesno|¬|¬=sausage}}</nowiki></tt> result "sausage"
# <tt><nowiki>{{yesno|purplemonkeydishwasher|def=cup-of-tea}}</nowiki></tt> result "cup-of-tea" (also applies to any other value not given above).
## but <tt><nowiki>{{yesno|purplemonkeydishwasher|yes=bacon}}</nowiki></tt> result "bacon"
## but <tt><nowiki>{{yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}}</nowiki></tt> result "cup-of-tea"
This may be used (apparently perversely) thus:
* <tt><nowiki>{{yesno|yes|yes=no|no=yes}}</nowiki></tt> result "no"
* <tt><nowiki>{{yesno|no|yes=no|no=yes}}</nowiki></tt> result "yes"
This creates a logical inversion.
<includeonly>
[[Category:Utility templates]]
</includeonly>
<noinclude></noinclude>
9b52921b40770edd126756223301b173f350e374
模板:SDA
10
738
1910
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Start date and age]]
49ac983ad14dd118d7c37dde91ea7e5673b9d91c
模板:Ubl
10
739
1911
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Unbulleted list]]
f7d6714e11262cf6afb1314371d3373c57cb6c08
模板:Ubt
10
740
1912
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Unbulleted list]]
f7d6714e11262cf6afb1314371d3373c57cb6c08
模板:Ublist
10
741
1913
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Unbulleted list]]
f7d6714e11262cf6afb1314371d3373c57cb6c08
模板:Pre2
10
742
1914
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<pre<includeonly></includeonly> style="{{#ifeq:{{{1}}}|scroll|overflow:auto; white-space:pre; width:auto;{{{style|}}}">{{#switch:{{{2}}}|nowiki|nw={{#tag:nowiki|{{{3}}}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;{{{style|}}}">{{#switch:{{{1}}}|nowiki|nw={{#tag:nowiki|{{{2}}}}}|{{{1}}}}} }}</pre><noinclude>
{{/doc}}</noinclude>
f9f440e0dd09308ce80e523c39507bb587db9851
模板:Wbr
10
743
1915
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<wbr />​<noinclude>
{{/doc}}
</noinclude>
24e44453e5215350516ba99b6450c2debf8c30c0
模板:Nbsp
10
744
1916
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
#REDIRECT [[Template:Spaces]]
d55076009c86bad01caacd67c545037409e5e1ee
模板:Nowrap
10
745
1917
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
<span class="nowrap">{{{1}}}</span><noinclude>
{{/doc}}
</noinclude>
51ff254d882b3db23f455e9f7b19d3df30656730
模板:Pre2/doc
10
746
1918
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{tl|Pre2}}} uses <code>{{WP|ref=no|HTML_element#Other_containers|<pre>}}</code> tags, but with text that is either {{WP|ref=no|word wrap|wrapped}} or is contained in a horizontal scrollbox. This means the text will not stretch past the right side of the screen.
As it uses real <pre> tags (unlike {{tl|pre}}), it will be displayed correctly regardless of how the user's Wikipedia {{WP|ref=no|WP:SKIN|text=skin}} renders <pre> boxes.
If you want to disable {{WP|ref=no|WP:Wikitext|text=wikitext}} in it, you should use <nowiki> tags inside the template (see [[#wikitext|below]]).
==Usage==
===Wrapped text===
<span style="background-color:white"><code><nowiki>{{Pre2|Text to be displayed. And more and more and more... and a paragraph break.</nowiki>
<p>
<nowiki>And then more and more...}}</nowiki></code></span>
:produces:
{{Pre2|Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.}}
===Scrollbox===
<span style="background:white"><code><nowiki>{{Pre2|scroll|Text to be displayed. And more and more and more... and a paragraph break.</nowiki>
<p>
<nowiki>And then more and more...}}</nowiki></code></span>
:produces:
{{Pre2|scroll|Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.}}
===Style===
When the text contains links is better to change the text color, thus highlighting:
<span style="background:black"><code><nowiki>{{Pre2|style=color:green|Text to be [[Hyperlink|link]]. WARNING! A{{=}}B, you must use Template:=. And more and more and more... and a paragraph break.</nowiki>
<p>
<nowiki>And then more and more...}}</nowiki></code></span>
:produces:
{{Pre2|style=color:green|Text to be link. WARNING! A{{=}}B, you must use Template:{{=}}. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.}}
<includeonly>
[[Category:Typing-aid templates]]
</includeonly>
<noinclude></noinclude>
07a1996b7dfc435615d059b7aa3651753b00b3c4
模板:Wbr/doc
10
747
1919
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
This template is used to tell the browser of an optional, non-hyphenated line-break. It can be used with:
* {{tlx|nbsp}} or the equivalent <code>&nbsp;</code> (non-breaking space)
* {{tlx|nowrap}} or the equivalent <code><nowiki><span class="nowrap">...</span></nowiki></code> (character string that will not break even at a normal space)
to carefully control line-breaking where this is important.
This template can safely be {{WP|ref=no|WP:SUBST|text=substituted}}, though there is no particular reason to do so.
==Usage==
Use is simple; there are no parameters:
* {{tlx|wbr}}
or
* {{tlxs|wbr}}
<includeonly>
[[Category:Formatting and function templates]]
</includeonly>
<noinclude></noinclude>
5cfb756ca1ea6480cd57b83309a0ea002121a347
模板:Nowrap/doc
10
748
1920
2023-03-12T08:09:54Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
{{tsh|nobr|nobreak}}
{{t|Nowrap}} stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph. Before you use this template you might want to read up on [[Wikipedia:Line-break handling]].
== Usage ==
:: <code><nowiki>{{nowrap|these words stay together}}</nowiki></code>
:: <code><nowiki>{{nowrap|a, b, c, or d.}}</nowiki></code>
:: <code><nowiki>{{nowrap| merry-go-round }}</nowiki></code>
:: <code><nowiki>{{nowrap| [[4-part harmony]] }}</nowiki></code>
:: <code><nowiki>{{nowrap| [[Cascading Style Sheets|CSS]] }}</nowiki></code>
:: <code><nowiki>{{nowrap| [[#Examples|Examples section]] }}</nowiki></code>
The template names {{tl|nobr}} and {{tl|nobreak}} are redirects that may be used instead of "{{tl|nowrap}}".
== TemplateData ==
<templatedata>{
"description": "Prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens (-).",
"params": {
"1": {
"label": "Text",
"description": "Text or link to be protected.",
"type": "string",
"required": true
}
}
}</templatedata>
<includeonly>
[[Category:Formatting and function templates]]
</includeonly>
850783c5a0842e27ae4c4777b1fd2876f833a3d7
小火龙
0
508
1671
2023-03-12T08:14:28Z
Pio
2
wikitext
text/x-wiki
[[文件:小火龙on公众号.jpg|替代=在杭二钱江公众号上的图片|缩略图|小火龙在杭二钱江公众号上的图片]]
{{引用|我的美术老师。|普通学生对[[小火龙]]的印象}}{{引用|我的老板。|某肉圆社长对[[小火龙]]的印象}}
{{引用|阿德利小火龙|[[小火龙]]对[[小火龙]]的印象}}
小火龙,杭二钱江美术老师,现[[红茶社]]的指导老师,也是红茶社的'''创始人'''之一。
== 简历 ==
=== 教育及职场经历 ===
2015年毕业于'''浙江大学'''艺术设计系视觉传达方向,并被'''保送'''本校设计学硕士研究生,2018年取得硕士学位。专业研究领域为插画、漫画创作、书籍装帧和平面设计。
创作并出版艺术书籍《音乐剧<伊丽莎白>纪念画集》,获'''第九届全国书籍设计艺术展插画类优秀奖''',并在2018年德国莱比锡国际书展举行专题活动。指导学生参加2020年杭州市社团文化节漫画大赛二等奖。获得2021年直属学校美术教师技能基本功比赛二等奖。
在专业上,对艺术充满热情,保持旺盛的好奇心和探究精神。在工作上,热爱学生,理解学生,'''能够融入学生之中'''。担任'''书画社、动漫社、音乐剧社'''的指导老师,组织学生开展漫画和动画创作、文创周边设计等活动。
=== slogon ===
希望和同学们一起通过艺术创作认识世界、认识生活、认识自己。<ref>强健体魄,滋润心田。杭州二中钱江学校体艺组简介 https://mp.weixin.qq.com/s/qmsXITBZ5QBn18SSNdqlfg</ref>
== 事迹 ==
=== 创作《二钱怪谈》校园传说漫画 ===
{{引用|起因是我朋友觉得我们学校很适合发生校园(闹)传说(鬼),我又喜欢从生活里挖灵感。画一半动起了坏心思,做了嵌套。这里放一个田园版。}}
简而言之言而简之,本漫画<ref>校园百物语系列之《笃笃》 https://mp.weixin.qq.com/s/rVf3tNa-_dBeXbNAUvBqxg</ref>包含灵异、搞笑、女性向、{{黑幕|温水煮青蛙}}等要素。
{{引用|创作这篇漫画的起因是之前我的同学来参观学校,问我:“你有没有觉得,你们学校很适合讲鬼故事?”
我:“???”
“校园传说什么的,没有吗?”
“像厕所里的桃金娘那种?我们学校太年轻了,还不够资历。”
“别那么死板,人造也不是不可以呀。有校园传说的学校,才显得有人味有底蕴有吸引力嘛。”
我:“……”
我的这位同学,中学时探遍了校园的每个角落。只要没锁的门都钻进去过,但凡能搁脚的楼梯都爬上去过。名副其实是个探险家。
她是她所就读初中的第一届学生,所以对我们新学校的草木和环境灯光分外熟悉。曾经她初中的校园也是崭崭新的,如今岁月沉淀,一草一木都有了故事。那我们的土壤里,也会滋生出自己的传说吧。}}
=== 联动舞蹈社发布舞蹈手书 ===
2021年4月24日,发布了与JD舞社<ref>【红茶馆动漫社+JD舞社】高中社团的手绘舞蹈动画《讨喜》原创编舞(真人) https://www.bilibili.com/video/BV1ao4y1f7Vd/</ref>联动的原创编舞的手绘舞蹈动画<ref>【红茶馆动漫社+JD舞社】高中社团的手绘舞蹈动画《讨喜》原创编舞 https://www.bilibili.com/video/BV1w54y1j7xG</ref>。
=== 拆分红茶社 ===
{{引用|一群看动漫、cos的怎么可以跟练书法的混在一起。}}2021学年第一学期,将红茶社拆出书法社。{{黑幕|若远帝刚上位就失去半数国民。}}
=== Stand by 女权 ===
{{Main|220813总群关于女权争议}}
== 参考 ==
<references />
[[分类:老师]]
21d49ca3beb72515408e60ebd16a375f0d5f455f
模板:Infobox buttons
10
751
1923
2023-03-12T09:05:36Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{#if:{{{type|}}}|
<div class="infobox-button noprint"><div class="infobox-extlink-button"><span class="infobox-extlink-button-icon">[[File:WikimediaUI-Globe.svg|16px|link=]]</span>Other sites</div><div class="infobox-extlink-list">
{{#if:{{{galactapediaurl|}}}{{{rsistoreurl|}}}{{{presentationurl|}}}{{{brochureurl|}}}{{{trailerurl|}}}{{{portfoliourl|}}}{{{starmapurl|}}}|<span class="infobox-extlink-title infobox-extlink-title-rsi">Official sites</span>
<ul class="infobox-extlink-list-rsi">
{{#if:{{{galactapediaurl|}}}|<li class="infobox-extlink" id="galactapedia">[{{{galactapediaurl}}} Galactapedia]</li>}} <!-- Galactapedia -->
{{#if:{{{rsistoreurl|}}}|<li class="infobox-extlink" id="rsistore">[{{{rsistoreurl}}} Pledge store]</li>}} <!-- RSI store -->
{{#if:{{{presentationurl1|}}}|<li class="infobox-extlink" id="presentation">[{{{presentationurl1}}} Presentation{{#if:{{{presentationurl2|}}}|{{nbsp}}1}}]</li>}} <!-- Presentation 1 -->
{{#if:{{{presentationurl2|}}}|<li class="infobox-extlink" id="presentation">[{{{presentationurl2}}} Presentation 2]</li>}} <!-- Presentation 2 -->
{{#if:{{{presentationurl3|}}}|<li class="infobox-extlink" id="presentation">[{{{presentationurl3}}} Presentation 3]</li>}} <!-- Presentation 3 -->
{{#if:{{{portfoliourl|}}}|<li class="infobox-extlink" id="portfolio">[{{{portfoliourl}}} Portfolio]</li>}} <!-- Portfolio -->
{{#if:{{{whitleysguideurl|}}}|<li class="infobox-extlink" id="whitleysguide">[{{{whitleysguideurl}}} Whitley's Guide]</li>}} <!-- Whitley's Guide -->
{{#if:{{{brochureurl|}}}|<li class="infobox-extlink" id="brochure">[{{{brochureurl}}} Brochure]</li>}} <!-- Brochure -->
{{#if:{{{trailerurl|}}}|<li class="infobox-extlink" id="trailer">[{{{trailerurl}}} Trailer]</li>}} <!-- Trailer -->
{{#if:{{{qandaurl1|}}}|<li class="infobox-extlink" id="qanda1">[{{{qandaurl1}}} Q&A{{#if:{{{qandaurl2|}}}|{{nbsp}}1}}]</li>}} <!-- Q&A 1 -->
{{#if:{{{qandaurl2|}}}|<li class="infobox-extlink" id="qanda2">[{{{qandaurl2}}} Q&A 2]</li>}} <!-- Q&A 2 -->
{{#if:{{{qandaurl3|}}}|<li class="infobox-extlink" id="qanda3">[{{{qandaurl3}}} Q&A 3]</li>}} <!-- Q&A 3 -->
{{#if:{{{starmapurl|}}}|<li class="infobox-extlink" id="starmap">[{{{starmapurl}}} ARK Starmap]</li>}} <!-- Starmap -->
</ul>
}}
{{#switch: {{{type}}}
|vehicle = {{#if:{{{nameid|}}}{{{matrixname|}}}|<span class="infobox-extlink-title infobox-extlink-title-community">Community sites</span>
<ul class="infobox-extlink-list-community">
{{#if:{{{nameid|}}}|<nowiki/>
<li class="infobox-extlink" id="dpscalculator">[https://www.erkul.games/ship/{{lc:{{{nameid}}}}} #DPSCalculator]</li> <!-- #DPSCalculator -->
<li class="infobox-extlink" id="spviewer">[https://www.spviewer.eu/pages/ships/{{lc:{{{nameid}}}}}.html SPViewer]</li> <!-- SC Ships Performances Viewer -->
<li class="infobox-extlink" id="tradeinspace">[https://tradein.space/#/ship_maps/{{lc:{{{nameid}}}}} TIS Ship Viewer]</li> <!-- TradeIn.Space Ship Viewer -->
}}<nowiki/>
{{#if:{{{matrixname|}}}|<nowiki/>
<li class="infobox-extlink" id="starship42">[https://www.starship42.com/fleetview/single/?source=Star%20Citizen%20Wiki&type=matrix&style=colored&s={{urlencode:{{{matrixname}}}}} StarShip 42]</li> <!-- StarShip 42 -->
<li class="infobox-extlink" id="fleetyards">[https://fleetyards.net/ships/{{lc:{{#invoke:String|replace|{{{matrixname}}}|%s|-||false}}}} FleetYards]</li> <!-- FleetYards -->
<!--<li class="infobox-extlink" id="galacticlogistics">[https://gallog.co/ships/{{lc:{{#invoke:String|replace|{{{matrixname}}}|%s|_||false}}}} Galactic Logistics]</li>--> <!-- Galactic Logistics -->
}}
</ul>
}}
|commodity = {{#if:{{{nameid|}}}|<span class="infobox-extlink-title infobox-extlink-title-community">Community sites</span>
<ul class="infobox-extlink-list-community">
{{#if:{{{nameid|}}}|<nowiki/>
<li class="infobox-extlink" id="galacticlogistics">[https://gallog.co/commodities/{{{type|unknown}}}/{{{nameid}}} Galactic Logistics]</li>
}}<nowiki/>
</ul>
}}
}}
</div></div>
}}<templatestyles src="Template:Infobox buttons/styles.css" /><noinclude>
{{/doc}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
7bfabf307645902e3b9b1017d7b439c004fc5498
模板:Infobox buttons/doc
10
752
1924
2023-03-12T09:05:37Z
Pio
2
导入1个版本
wikitext
text/x-wiki
{{Documentation}}
This template generates the external link button used by some infobox templates. It is meant to be used inside another template instead of directly.
== See also ==
* {{t|In-game name}} - template used to convert wiki page name into in-game entities
* {{t|Ship matrix name}} - template used to convert wiki page name into ship names on RSI website
== Parameters ==
;type
:Determine what external link should be generated
;galactapediaurl
:The Galactapedia URL of the entity
;rsistoreurl
:The RSI store page URL of the entity
;presentationurl
:The latest announcement comm-link URL of the entity
;brochureurl
:The brochure URL of the entity
;trailerurl
:The trailer URL of the entity
;Support link table
{| class="wikitable"
! Link type
! vehicle
! commodity
! company
! location
|-
| galactapediaurl || align="center"| ✓ || align="center"| ✓ || align="center"| ✓ || align="center"| ✓
|-
| rsistoreurl || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| presentationurl{1,2,3} || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| portfoliourl || align="center"| - || align="center"| - || align="center"| ✓ || align="center"| -
|-
| brochureurl || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| whitleysguideurl || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| trailerurl || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| qandaurl{1,2,3} || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| starmapurl || align="center"| - || align="center"| - || align="center"| - || align="center"| ✓
|-
| [https://www.erkul.games #DPSCalculator] || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| [https://www.spviewer.eu/ SC Ships Performances Viewer] || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| [https://tradein.space/ TradeIn.Space] || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| [https://www.starship42.com StarShip 42] || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|-
| [https://fleetyards.net FleetYards] || align="center"| ✓ || align="center"| - || align="center"| - || align="center"| -
|}
<includeonly>[[Category:Infobox utility templates|{{PAGENAME}}]]</includeonly>
<noinclude></noinclude>
2addc41470f7ec2c2326aed7b622dd8f38d1742b
文件:WikimediaUI-Article-ltr.svg
6
721
1893
2023-03-12T13:54:28Z
Pio
2
已保护“[[文件:WikimediaUI-Article-ltr.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:WikimediaUI-Alert.svg
6
718
1890
2023-03-12T13:54:41Z
Pio
2
已保护“[[文件:WikimediaUI-Alert.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:Wikipedia-logo-v2.svg
6
717
1889
2023-03-12T13:54:58Z
Pio
2
已保护“[[文件:Wikipedia-logo-v2.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:WikimediaUI-ArticleDisambiguation-ltr.svg
6
715
1887
2023-03-12T13:55:10Z
Pio
2
已保护“[[文件:WikimediaUI-ArticleDisambiguation-ltr.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:WikimediaUI-Logo-Wikipedia.svg
6
611
1783
2023-03-12T13:55:24Z
Pio
2
已保护“[[文件:WikimediaUI-Logo-Wikipedia.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:WikimediaUI-Notice.svg
6
597
1769
2023-03-12T13:55:36Z
Pio
2
已保护“[[文件:WikimediaUI-Notice.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:WikimediaUI-Code.svg
6
596
1768
2023-03-12T13:55:56Z
Pio
2
已保护“[[文件:WikimediaUI-Code.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:SCW-Verified.svg
6
578
1750
2023-03-12T13:56:07Z
Pio
2
已保护“[[文件:SCW-Verified.svg]]”:系统文件([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)[上传=仅允许管理员](无限期))
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
User blog:Loli/Imported templates need to be translated
502
754
1926
2023-03-12T14:05:38Z
Pio
2
已创建新的博客帖子。
wikitext
text/x-wiki
<!--start text-->
从 [[citizencn:首页|StarcitizenWiki]] 拉了一堆模板,等待翻译ing。
[[分类:用户Loli的文章]]
[[分类:2023年3月12日 (星期日)]]
__NOEDITSECTION__
52bb47a6ff130c669c8b74a81c45a2d1f83c998f
用户:Loli/sandbox
2
750
1922
2023-03-17T12:05:14Z
Pio
2
wikitext
text/x-wiki
{{Infobox
|bodyclass = mw-collapsible floatright
|image1 = [[文件:8350C84E-FD64-4C66-8417-CD14A63E0136.jpeg|400px]]
|imagerowclass1 = infobox-image
|header2 = 姓名
|rowclass2 = infobox-title
|label4 = 短描述
|data4 = 短描述
|rowclass4 = infobox-subtitle infobox-data infobox-col1
|label5 = 姓名
|data5 = 姓名
|rowclass5 = infobox-data infobox-col3
|label6 = 性别
|data6 = 性别
|rowclass6 = infobox-data infobox-col3
|label7 = 年龄
|data7 = 年龄
|rowclass7 = infobox-data infobox-col3
|header8 = 外貌
|rowclass8 = infobox-header
|label9 = 身高
|data9 = 身高
|rowclass9 = infobox-data infobox-col2
|label10 = 体重
|data10 = 体重
|rowclass10 = infobox-data infobox-col2
|label11 = 发色
|data11 = 发色
|rowclass11 = infobox-data infobox-col2
|label12 = 三围
|data12 = 三围
|rowclass12 = infobox-data infobox-col2
|header13 = 其他
|rowclass13 = infobox-header
|label14 = 种族
|data14 = 种族
|rowclass14 = infobox-data infobox-col2
|label15 = 生日
|data15 = 生日
|rowclass15 = infobox-data infobox-col2
|label16 = 血型
|data16 = 血型
|rowclass16 = infobox-data infobox-col2
|label17 = 星座
|data17 = 星座
|rowclass17 = infobox-data infobox-col2
|label18 = 萌点
|data18 = 萌点
|rowclass18 = infobox-data infobox-col2
|label19 = 个人状态
|data19 = 个人状态
|rowclass19 = infobox-data infobox-col2
|label20 = 相关人
|data20 = 相关人
|rowclass20 = infobox-data infobox-col1
|header99 = {{Template:Infobox_buttons}}
|rowclass99 = infobox-button-bar
}}
7a53338b467310e498180985175447d907ce1a19
2022换届
0
527
1698
2023-03-18T10:03:37Z
Pio
2
wikitext
text/x-wiki
== 简介 ==
此活动目的为选举出2022学年社团管理人员,由2021学年社长[[肉圆]]主持。
6月18日,[[小火龙]]发布公告:红茶动漫社2022换届时间为6.23(周四)中午12:40,在美术教室举行。活动如期举行,相关结果将于学考后由[[小火龙]]公布。
{| class="wikitable"
! <div style="color:purple">姓名</div> !! <div style="color:blue">结果</div>
|-
| 鸟头人 || 社长
|-
| 小狐狸 || 副社长
|-
| 时守宫Elona || 副社长
|}
[[分类:管理层]]
[[分类:换届]]
8f6775fb57e97c66378e58219bc63cf9e84c4fd9
MediaWiki:Citizen-footer-tagline
8
559
1730
2023-03-18T10:11:06Z
Pio
2
wikitext
text/x-wiki
Darkness cannot drive out darkness, only light can. Hate cannot drive out hate, only love can.
a30cf71af2c77f9642b62fc52b9740e3446e682c
模板:Plainlist/styles.css
10
635
1807
2023-03-18T12:00:20Z
Pio
2
导入1个版本
sanitized-css
text/css
da39a3ee5e6b4b0d3255bfef95601890afd80709
模板:Infobox buttons/styles.css
10
753
1925
2023-03-18T12:09:37Z
Pio
2
sanitized-css
text/css
/* Infobox button */
.infobox-button {
position: relative;
}
.infobox-extlink-button {
display: block;
padding: 10px 20px;
background: var( --color-primary );
border-radius: 0 0 12px 12px;
color: #fff;
}
.infobox-extlink-button-icon {
margin-right: 8px;
filter: invert( 1 );
}
/* Popup card */
.infobox-extlink-list {
position: absolute;
z-index: -1;
overflow: hidden;
width: 100%;
padding: 5px 0;
background: var( --color-surface-1 );
border-radius: var( --border-radius--medium );
box-shadow: var( --box-shadow-dialog );
opacity: 0;
text-align: left;
transition: transform 250ms ease, opacity 250ms ease;
visibility: hidden;
transform: translateY( -20px );
}
.infobox-extlink-list p {
margin-bottom: 0;
}
.infobox-button:hover .infobox-extlink-list {
z-index: 10;
opacity: 1;
visibility: visible;
transform: none;
}
.infobox-extlink-title {
display: block;
padding: 0 15px;
margin: 5px 0;
color: var( --color-base--subtle );
font-size: 0.8125rem;
font-weight: normal;
letter-spacing: 0.75px;
}
.infobox-extlink-list ul {
display: flex;
flex-wrap: wrap;
padding: 0 5px;
margin: 0 0 10px 0;
list-style: none;
}
.infobox-extlink a.external {
display: block;
/* Override external link and file icons */
padding: 5px 10px;
background-image: none;
border-radius: 4px;
transition: background 0.2s ease, color 0.2s ease;
}
.infobox-extlink a:hover {
background-color: var( --background-color-quiet--hover );
}
.infobox-extlink a:active {
background-color: var( --background-color-quiet--active );
}
.infobox-extlink-title:before {
position: absolute;
z-index: -1;
right: 20px;
display: block;
width: 120px;
height: 120px;
margin-top: 5px;
background-position: top right;
background-repeat: no-repeat;
background-size: contain;
opacity: 0.1;
}
.infobox-extlink-title-rsi:before {
/* TemplateStyles does not like internal link for some reason */
background-image: url( https://llk.cc/images/4/40/RSItm.svg );
content: '';
}
.infobox-extlink-title-community:before {
/* TemplateStyles does not like internal link for some reason */
background-image: url( https://llk.cc/images/3/3f/MadeByTheCommunity.svg );
content: '';
}
/* Dark mode */
html.skin-citizen-dark .infobox-extlink-title:before {
filter: invert( 1 );
}
bf7dda5cd54330d597d98fa91364b61063bcfc26
文件:RSItm.svg
6
755
1927
2023-03-18T12:11:02Z
Pio
2
使用UploadWizard上传自己的作品
wikitext
text/x-wiki
=={{int:filedesc}}==
{{Information
|description={{zh-cn|1=system}}
|date=2023-03-18
|source={{own}}
|author=[[User:Loli|Loli]]
|permission=
|other versions=
}}
=={{int:license-header}}==
{{licensing|generic}}
e60565aea40bb8e4f8bec3196df653e05702527a
文件:MadeByTheCommunity.svg
6
756
1928
2023-03-18T12:11:02Z
Pio
2
使用UploadWizard上传自己的作品
wikitext
text/x-wiki
=={{int:filedesc}}==
{{Information
|description={{zh-cn|1=system}}
|date=2023-03-18
|source={{own}}
|author=[[User:Loli|Loli]]
|permission=
|other versions=
}}
=={{int:license-header}}==
{{licensing|generic}}
e60565aea40bb8e4f8bec3196df653e05702527a
模板:Wikipedia template
10
607
1779
2023-03-18T12:13:31Z
Pio
2
wikitext
text/x-wiki
<includeonly><!--
Message box
--><div class="mbox mbox-low mbox-wikipediatemplate" role="presentation"><span class="mbox-title"><span class="mbox-icon metadata">[[File:WikimediaUI-Logo-Wikipedia.svg|14px|link=]]</span>This template is imported from {{FULLPAGENAME}} on Wikipedia.</span>
<div class="mbox-text">This template is imported from the [https://en.wikipedia.org English Wikipedia]. Although the visual appearance might be different, the functionality is identical. Please refer to the [[Wikipedia:{{FULLPAGENAME}}|{{FULLPAGENAME}}]] page on Wikipedia for detailed documentation.</div>
</div><!--
TemplateStyles
--><templatestyles src="Template:Mbox/styles.css" /><!--
Check if the page is a documentation page
-->{{#ifeq:{{SUBPAGENAME}}|doc||[[Category:Templates imported from Wikipedia|{{PAGENAME}}]]}}</includeonly><noinclude>
{{/doc}}</noinclude>
3ace6263da375a671cf4b31a02c6897b9e0467d4
模板:Wikipedia template/doc
10
757
1929
2023-03-18T12:14:30Z
Pio
2
创建页面,内容为“{{Documentation}} This template is used to indicate a template is imported from [https://en.wikipedia.org English Wikipedia]. It should be placed at the top of the template documentation page. <includeonly>[[Category:Article management templates|{{PAGENAME}}]]</includeonly><noinclude></noinclude>”
wikitext
text/x-wiki
{{Documentation}}
This template is used to indicate a template is imported from [https://en.wikipedia.org English Wikipedia]. It should be placed at the top of the template documentation page.
<includeonly>[[Category:Article management templates|{{PAGENAME}}]]</includeonly><noinclude></noinclude>
bb683778568879ff5ad6485d7389d92a9c8f77f3
模板:Mbox/styles.css
10
713
1885
2023-03-18T12:15:13Z
Pio
2
sanitized-css
text/css
.mbox {
position: relative;
display: flex;
flex-direction: column;
margin-top: var( --space-xs );
margin-bottom: var( --space-md );
background-color: var( --color-surface-2 );
border-radius: var( --border-radius--medium );
color: var( --color-base--subtle );
font-size: 0.875rem;
}
.mbox.mbox-high {
background-color: var( --background-color-destructive );
}
.mbox.mbox-med {
background-color: var( --background-color-warning );
}
.mbox-title {
display: flex;
align-items: center;
padding: var( --space-sm ) var( --space-md );
font-weight: 500;
}
.mbox-icon img {
width: 14px;
height: auto;
margin-right: var( --space-xs );
opacity: 0.5;
}
.mbox-text {
position: absolute;
z-index: 10;
padding: var( --space-md );
width: 100%;
box-sizing: border-box;
background-color: var( --color-surface-2 );
border-radius: var( --border-radius--medium );
box-shadow: var( --box-shadow-dialog );
opacity: 0;
visibility: hidden;
}
.mbox:hover .mbox-text {
opacity: 1;
visibility: visible;
}
.mbox-high .mbox-text {
background-color: var( --background-color-destructive );
}
.mbox-med .mbox-text {
background-color: var( --background-color-warning );
}
/* Dark mode */
html.skin-citizen-dark .mbox-icon img {
filter: invert( 1 );
}
/* Readability fixes */
html.skin-citizen-dark .mbox {
color: var( --color-base--emphasized );
}
418a88b9b2d0e260c82aab77352d45619b9b893b
模板:Hlist/styles.css
10
749
1921
2023-03-18T12:15:52Z
Pio
2
sanitized-css
text/css
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
ad2cb29b8df8d60f4deeb6a5e29187e1003123fe
模块:Key/styles.css
828
707
1879
2023-03-18T12:16:16Z
Pio
2
sanitized-css
text/css
.keyboard-key {
padding: 0.25em 0.5em;
display: inline-block;
line-height: 1;
font-weight: var( --font-weight-medium );
font-size: 0.875rem;
border-radius: var( --border-radius--small );
border: 1px solid;
border-color: var( --border-color-base );
background: var( --color-surface-3 );
color: var( --color-base--emphasized );
}
6dfb369e32fb7c72a7ca795a35457c6cf2df29cf
模块:Shortcut/styles.css
828
637
1809
2023-03-18T12:16:38Z
Pio
2
sanitized-css
text/css
.module-shortcutboxplain {
float: right;
margin: 0.8rem 0 0.8rem 1rem;
padding: 10px;
color: var( --color-base--subtle );
background: var( --color-surface-2 );
border-radius: 8px;
text-align: center;
}
.module-shortcutlist {
margin-bottom: 0.2rem;
font-weight: bold;
font-size: 0.825rem;
}
.module-shortcutboxplain ul {
margin: 0!important;
padding: 0!important;
list-style: none;
}
.module-shortcutboxplain li {
font-size: 0.875rem;
}
ff7cce098b3dfda11f1bb051f25bd10790151a1d
模块:Plainlist/styles.css
828
758
1930
2023-03-18T12:17:32Z
Pio
2
创建页面,内容为“.plainlist ol, .plainlist ul { line-height: inherit; list-style: none; margin: 0; } .plainlist ol li, .plainlist ul li { margin-bottom: 0; }”
sanitized-css
text/css
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
70dbbb0b065f02c3eab8b20d3b449b30d04d8994
模块:Hatnote/styles.css
828
714
1886
2023-03-18T12:18:01Z
Pio
2
sanitized-css
text/css
.hatnote-container {
display: flex;
align-items: center;
padding: var( --space-sm ) var( --space-md );
margin-top: var( --space-xs );
margin-bottom: var( --space-md );
background: var( --color-surface-2 );
border-radius: var( --border-radius--medium );
color: var( --color-base--subtle );
font-size: 0.875rem;
line-height: var( --line-height-xs );
}
.hatnote-icon img {
width: 14px;
height: auto;
margin-right: var( --space-xs );
opacity: var( --opacity-icon-base );
}
/* Dark theme */
html.skin-citizen-dark .hatnote-icon img {
filter: invert( 1 );
}
44850b74680c356f2514e4292d2130fb67f3b46d
模板:Documentation/styles.css
10
595
1767
2023-03-18T12:18:28Z
Pio
2
sanitized-css
text/css
.documentation {
display: flex;
box-sizing: border-box;
flex-direction: column;
margin: 1.6rem 0;
padding-top: 1.6rem;
border-top: 1px solid;
border-color: var( --border-color-base );
border-radius: var( --border-radius--medium );
font-size: 0.875rem;
}
.documentation-header {
margin-top: 0;
margin-bottom: 0.8rem;
color: var( --color-base--emphasized );
font-size: 1.25rem;
font-weight: 600;
line-height: 1.2;
}
.documentation-subheader {
margin: -0.6rem 0 1.6rem 0;
color: var( --color-base--subtle );
font-size: 0.825rem;
}
.documentation-links {
margin: 0.3rem 0;
float: right;
font-family: monospace;
font-size: 0.875rem;
font-weight: 400;
}
/**
* Tooltip styles used by DependencyList,
* shouldn't be here but it is only used here anyways
*/
.hatnote-container {
position: relative;
}
.tooltip-trigger {
padding: 0.2rem 0.5rem;
margin-right: 2px;
background: var( --color-primary );
border-radius: 100px;
color: #fff;
}
.tooltip-trigger:hover {
background: var( --color-primary--hover );
}
.tooltip-content {
position: absolute;
z-index: 1;
right: 0;
padding: 15px;
background-color: var( --color-surface-1 );
border-radius: var( --border-radius--medium );
box-shadow: 0 14px 28px rgba( 0, 0, 0, 0.06 ), 0 10px 10px rgba( 0, 0, 0, 0.06 );
visibility: hidden;
}
.tooltip-content > ol {
margin-top: 0;
margin-left: 1.2rem;
}
.tooltip-content:hover,
.tooltip-trigger:hover + .tooltip-content {
visibility: visible;
}
552a2ef58c855aeb5d64925fe10a6b40fb8ccd85
模板:Infobox/styles.css
10
719
1891
2023-03-18T12:20:18Z
Pio
2
sanitized-css
text/css
.infobox {
/* In case if tooltips go out of boundary */
overflow: visible;
width: 100%;
max-width: 400px;
margin-top: 0;
margin-bottom: 1.6rem;
background: var( --color-surface-2 );
border-radius: var( --border-radius--medium );
border-spacing: 0;
box-shadow: var( --box-shadow-card );
font-size: 0.875rem;
text-align: left;
}
/* Table elements */
.infobox tbody {
display: flex;
flex-wrap: wrap;
}
.infobox tr {
display: flex;
box-sizing: border-box;
flex-direction: column;
padding: 0 10px;
margin-top: 10px;
}
.infobox th,
.infobox td {
padding: 0 5px;
}
/* Infobox column */
.infobox .infobox-nocol {
width: 100%;
flex-direction: row;
}
.infobox .infobox-nocol th {
width: 30%;
}
.infobox .infobox-nocol td {
width: 70%;
}
.infobox .infobox-col1 {
width: 100%;
}
.infobox .infobox-col2 {
width: 50%;
}
.infobox .infobox-col3 {
width: calc( 100% / 3 );
}
.infobox .infobox-col4 {
width: 25%;
}
.infobox-data {
min-width: 25%;
}
/* Infobox image */
.infobox .infobox-image {
overflow: hidden;
padding: 0;
margin-top: 0;
border-radius: var( --border-radius--medium ) var( --border-radius--medium ) 0 0;
}
.infobox-image td {
padding: 0;
}
.infobox-image--light .image {
background: #eaecf0;
}
.infobox-image--dark .image {
background: #2b2f36;
}
.infobox-image .image:hover img {
transform: scale( 1.1 );
}
.infobox-image img {
display: block;
max-width: 100%;
background: var( --background-color-quiet--hover );
}
/* Neutral background for all transprent SVG */
.infobox-image img[ src$='.svg' ] {
background: #eaecf0;
}
/* Infobox title */
.infobox .infobox-title {
width: 100%;
margin-top: 20px;
margin-bottom: 5px;
color: var( --color-base--emphasized );
font-size: 1.4rem;
line-height: 1.4;
}
/* Infobox indicator */
.infobox .infobox-indicator {
margin-top: 0;
padding: 0;
}
/* Infobox subtitle */
.infobox .infobox-subtitle {
/* Cancel infobox-title bottom margin */
margin-top: -5px;
margin-bottom: 5px;
}
.infobox .infobox-indicator th,
.infobox .infobox-subtitle th {
display: none;
}
/* Infobox header */
.infobox .infobox-header {
width: 100%;
padding-top: 15px;
border-top: 1px solid;
border-color: var( --border-color-base );
margin-top: 15px;
color: var( --color-base--emphasized );
font-size: 1rem;
}
/* Infobox value */
.infobox-data th {
color: var( --color-base--subtle );
font-size: 0.8125rem;
font-weight: normal;
letter-spacing: 0.75px;
}
.infobox-data td {
font-weight: 600;
}
.infobox-data ul,
.infobox-data ol {
margin-top: 0;
}
/* Infobox button */
.infobox .infobox-button-bar {
width: 100%;
padding: 0;
margin-top: 25px;
text-align: center;
}
.infobox-button-bar th {
padding: 0;
}
/* Collapsible toggle */
.infobox tr:first-of-type .mw-collapsible-toggle {
position: relative;
display: none;
float: none;
}
.infobox tr:first-of-type .mw-collapsible-toggle .mw-collapsible-text {
position: absolute;
right: 0;
display: block;
padding: 5px 15px;
background: var( --color-destructive );
border-radius: 0 var( --border-radius--medium );
color: #fff;
}
.infobox tr:first-of-type .mw-collapsible-toggle .mw-collapsible-text:hover {
background: var( --color-destructive--hover );
}
.infobox tr:first-of-type .mw-collapsible-toggle .mw-collapsible-text:active {
background: var( --color-destructive--active );
}
.infobox tr:first-of-type .mw-collapsible-toggle-collapsed .mw-collapsible-text {
background: var( --color-primary );
}
.infobox tr:first-of-type .mw-collapsible-toggle-collapsed .mw-collapsible-text:hover {
background: var( --color-primary--hover );
}
.infobox tr:first-of-type .mw-collapsible-toggle-collapsed .mw-collapsible-text:active {
background: var( --color-primary--active );
}
.infobox tr:first-of-type .mw-collapsible-toggle:before,
.infobox tr:first-of-type .mw-collapsible-toggle:after {
content: none;
}
@media only screen and ( max-width: 720px ) {
.infobox {
margin-right: auto;
margin-left: auto;
}
.infobox tr:first-of-type .mw-collapsible-toggle {
display: block;
}
}
d0742bbc307a1ae6bf714e235ead8e7ebb007b89
模块:Documentation
828
587
1759
2023-03-18T12:25:21Z
Pio
2
Scribunto
text/plain
-- <nowiki>
local dependencyList = require( 'Module:DependencyList' )
local yn = require( 'Module:Yesno' )
local p = {}
function p.doc( frame )
local title = mw.title.getCurrentTitle()
local args = frame:getParent().args
local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' )
local addDependencyList = yn( args.DependencyList or true )
local ret, cats, ret1, ret2, ret3
local onModule = title.namespace == 828
-- subpage header
if title.subpageText == 'doc' then
ret = mw.html.create( nil )
:tag( 'div' )
:addClass( 'mbox mbox-low mbox-documentationsub' )
:attr( 'role', 'presentation')
:tag( 'span' )
:addClass( 'mbox-title' )
:tag( 'span' )
:addClass( 'mbox-icon metadata' )
:wikitext( '[[File:WikimediaUI-Notice.svg|14px|link=]]' )
:done()
:wikitext( 'This is a documentation subpage for ' .. page .. '.' )
:done()
:tag( 'span' )
:addClass( 'mbox-text' )
:wikitext(
string.format(
'It contains usage information, categories, and other content that is not part of the [[' .. page .. '|original %s page]].',
onModule and 'module' or 'template'
)
)
:done()
:done()
:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Mbox/styles.css'} })
:done()
if title.namespace == 10 then -- Template namespace
cats = '[[Category:Template documentation|' .. title.baseText .. ']]'
ret2 = addDependencyList and dependencyList._main() or ''
elseif title.namespace == 828 then -- Module namespace
cats = '[[Category:Module documentation|' .. title.baseText .. ']]'
ret2 = addDependencyList and dependencyList._main() or ''
else
cats = ''
ret2 = ''
end
return tostring( ret ) .. ret2 .. cats
end
-- template header
-- don't use mw.html as we aren't closing the main div tag
ret1 = '<div class="documentation">'
ret2 = mw.html.create( nil )
:tag( 'div' )
:addClass( 'documentation-header' )
:tag( 'span' )
:addClass( 'documentation-title' )
:wikitext( string.format('%s documentation', onModule and 'Module' or 'Template') )
:done()
:tag( 'span' )
:addClass( 'documentation-links plainlinks' )
:wikitext(
'[[' .. tostring( mw.uri.fullUrl( page .. '/doc', {action='view'} ) ) .. ' view]]' ..
'[[' .. tostring( mw.uri.fullUrl( page .. '/doc', {action='edit'} ) ) .. ' edit]]' ..
'[[' .. tostring( mw.uri.fullUrl( page .. '/doc', {action='history'} ) ) .. ' history]]' ..
'[<span class="jsPurgeLink">[' .. tostring( mw.uri.fullUrl( title.fullText, {action='purge'} ) ) .. ' purge]</span>]'
)
:done()
:done()
:tag( 'div' )
:addClass( 'documentation-subheader' )
:tag( 'span' )
:addClass( 'documentation-documentation' )
:wikitext( 'This documentation is transcluded from [[' .. page .. '/doc]]. Changes can be proposed in the talk page.' )
:done()
:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Mbox/styles.css'} })
:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Documentation/styles.css'} })
:done()
ret3 = addDependencyList and dependencyList._main() or ''
return ret1 .. tostring( ret2 ) .. '<div class="documentation-content">' .. ret3
end
return p
-- </nowiki>
81424edaa28738eddaa907589bb85ebb1c8c3cc7
模板:About
10
666
1838
2023-03-18T12:27:54Z
Pio
2
wikitext
text/x-wiki
{{#invoke:about|about}}<noinclude>{{/doc}}</noinclude>
31588bea1217143bcbe6afeafbafdbfe681d5aac
模板:DependencyList
10
695
1867
2023-03-18T12:28:15Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:DependencyList|main}}</includeonly><noinclude>{{/doc}}</noinclude>
923ee81c4d72af3821df33a5c39b6e427e2dd755
模板:Error
10
679
1851
2023-03-18T12:28:32Z
Pio
2
wikitext
text/x-wiki
{{#invoke:Error|error|{{{message|{{{1}}}}}}|tag={{{tag|}}}}}<noinclude>
{{/doc}}
</noinclude>
cab206ba0f999de90617c9eae57081194bb8e3c5
模板:For
10
644
1816
2023-03-18T12:28:56Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:For|For}}</includeonly><noinclude>{{/doc}}</noinclude>
fe574af3095a9f8a2e691e0395705bf33dc28ad2
模板:Hatnote
10
601
1773
2023-03-18T12:29:36Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote|hatnote}}</includeonly><noinclude>{{/doc}}</noinclude>
d9029e1bc2de056708cda99e6ce883644c1661e4
模板:Infobox
10
581
1753
2023-03-18T12:29:56Z
Pio
2
wikitext
text/x-wiki
<templatestyles src="Template:Infobox/styles.css" />{{#invoke:Infobox|infobox}}<noinclude>
{{/doc}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
8848f31342e738b06a687383111e22a749109f7f
模板:Legend
10
658
1830
2023-03-18T12:30:11Z
Pio
2
wikitext
text/x-wiki
<includeonly><!--
--><div class="legend"><span class="legend-color" style="<!--
-->{{#if:{{{border|}}}|border: {{{border}}};|{{#if:{{{outline|}}}|border: 1px solid {{{outline}}};}}}} <!--
-->{{#if:{{{1|}}}|background-color:{{{1}}};}}<!--
-->{{#if:{{{textcolor|}}}|color:{{{textcolor}}};}}<!--
-->{{#if:{{{size|}}}|font-size:{{{size}}};}}"><!--
-->{{#if:{{{text|}}}|<span class="legend-text">{{{text}}}</span>| }}</span><!--
--> {{{2|}}}</div><!--
--><templatestyles src="Template:Legend/styles.css" /><!--
--></includeonly><noinclude>{{/doc}}</noinclude>
51c9b251619fd979a13142210ff407d3fd0e330c
模板:Main
10
643
1815
2023-03-18T12:30:33Z
Pio
2
wikitext
text/x-wiki
{{#invoke:main|main}}<noinclude>{{/doc}}</noinclude>
91fc56ae289486e388f815b2f84101dae0055111
模板:Note
10
602
1774
2023-03-18T12:32:32Z
Pio
2
wikitext
text/x-wiki
#REDIRECT [[Template:Hatnote]]
9582e82fbead373024765d896e4930eee521d846
模板:Redirect
10
684
1856
2023-03-18T12:32:53Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:redirect hatnote|redirect|1}}</includeonly><noinclude>{{/doc}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
143f585f107e2f0bd2cbe8e86a43c0667d88fc94
模板:See also
10
664
1836
2023-03-18T12:33:10Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:Labelled list hatnote|labelledList|See also}}</includeonly><noinclude>{{/doc}}</noinclude>
148e9d92e4ded01904c834d722442cb2d799d2ef
模板:Shortcut
10
680
1852
2023-03-18T12:33:26Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main}}</includeonly><noinclude>{{/doc}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
443b82d76c1b29b337defa2f4cab6d9549bab8f2
模板:Tc
10
706
1878
2023-03-18T12:33:50Z
Pio
2
wikitext
text/x-wiki
#REDIRECT [[Template:Template link code]]
be5d6275ea41d83224503e05901f3405c82141f7
模板:Template link code
10
616
1788
2023-03-18T12:34:02Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude>
{{Template:Template link general/doc}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
8d210e53c18acd93bbf28b60ae29ef99345fea5d
模板:Template link general
10
618
1790
2023-03-18T12:34:28Z
Pio
2
wikitext
text/x-wiki
{{{{{|safesubst:}}}#Invoke:Template link general|main}}<noinclude>
{{/doc}}
</noinclude>
66bd000b27dc95df42568346c185334f805221b0
模板:Tl
10
615
1787
2023-03-18T12:35:10Z
Pio
2
wikitext
text/x-wiki
#REDIRECT [[Template:Template link general]]
9842c9284f318753d4aa6ab9ac9aff29acbbbb59
模板:WP
10
687
1859
2023-03-18T12:35:23Z
Pio
2
wikitext
text/x-wiki
<includeonly><span class="plainlinks">{{#ifeq:{{{ref|}}}|no|[[File:Wikipedia-logo-v2.svg|x15px|link=http://wikipedia.org]] [http://wikipedia.org/wiki/{{{1}}} {{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}]|{{#tag:ref|[[File:Wikipedia-logo-v2.svg|x15px|link=http://wikipedia.org]] [http://wikipedia.org/wiki/{{{1}}} {{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}]}}}}</span></includeonly><noinclude>[[Category:Citation templates]]{{/doc}}</noinclude>
cac3c676e09fb57573cfa17ef103f7b1230aba41
模板:引用
10
506
1669
2023-03-18T12:36:47Z
Pio
2
wikitext
text/x-wiki
<noinclude>
{{/doc}}
</noinclude>
<includeonly><table style="display: table; border-collapse: collapse; margin: auto; background-color:transparent;">
<tr>
<td style="vertical-align: top; color:#B2B7F2; font-size:36px; font-family:'Times New Roman',serif; font-weight:bold; text-align:left; padding:10px 10px; line-height:100%">{{{open|“}}}</td>
<td style="text-align: left; padding: 1em; vertical-align: middle;">{{{1|}}}</td>
<td style="vertical-align: bottom; color:#B2B7F2; font-size:36px; font-family:'Times New Roman',serif; font-weight:bold; text-align:left; padding:10px 10px; line-height:100%">{{{close|”}}}</td>
</tr>{{#if:{{{2|}}}|
<tr><td colspan="3" style="font-size: smaller; text-align: right; padding-right: 4%;"><cite style="font-style:normal;">——{{{2}}}{{#if:{{{3|}}}|,{{{3}}}|}}</cite>
</td></tr>}}
</table></includeonly>
75112b6a845091aac697e15a8c28ee746ab64586
模板:引用/doc
10
759
1931
2023-03-18T12:38:55Z
Pio
2
创建页面,内容为“{{Documentation}} == 使用说明 == * {{{1}}}:引言文字。 * {{{2}}}:作者。 * {{{3}}}:出处。 * {{{open}}}:设置作为左引号的文字,默认值为“。 * {{{close}}}:设置作为右引号的文字,默认值为”。”
wikitext
text/x-wiki
{{Documentation}}
== 使用说明 ==
* {{{1}}}:引言文字。
* {{{2}}}:作者。
* {{{3}}}:出处。
* {{{open}}}:设置作为左引号的文字,默认值为“。
* {{{close}}}:设置作为右引号的文字,默认值为”。
23a4e959cc88475ec327fea5a9184a33b2cab3ef
模板:黑幕
10
507
1670
2023-03-18T12:42:36Z
Pio
2
wikitext
text/x-wiki
<noinclude>
{{/doc}}</noinclude><includeonly><span title="{{{2|你知道的太多了}}}" class="heimu">{{{1}}}</span></includeonly>
7b9412da8fe563c631ddc265b56c7830bbec6846
模板:黑幕/doc
10
599
1771
2023-03-18T12:43:43Z
Pio
2
wikitext
text/x-wiki
{{Documentation}}
第一个参数是黑幕下语句,第二个是鼠标悬浮时显示内容。
使用例:
<nowiki>{{黑幕|233|666}}</nowiki> -> {{黑幕|233|666}}
7b4aab6f8cc705516542c73b5606e838fb6ae543
文件:Celts in Europe.png
6
760
1932
2023-03-18T12:49:57Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:AltGr Win Menu Ctrl key.jpg
6
761
1933
2023-03-18T12:50:11Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:Ctl wndws alt.jpg
6
762
1934
2023-03-18T12:50:23Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
肉圆
0
526
1697
2023-03-18T13:02:12Z
Pio
2
wikitext
text/x-wiki
<div style='text-align: center;'><big><big>伟大的社长(已退位)</big></big></div>
{{引用|奉旨朕钦奉[[用户:Loli]]懿旨:<br>前因红茶换届,社长相应,社员沸腾,万物竟发,特命陈肉圆遣员与社员代表讨论大局,议开会议,公决政体。一周以来,尚无确当办法,南北暌隔,彼此相持,商辍於途,士露於野,徒以团队一日不决,故民生一日不安。今全社社员心理,多倾向共和,社团各部既倡议于前,北方诸将亦主张于后,人心所向,天命可知,予亦何忍因社长之建议,拂兆民之好恶?是用外观大势,内审舆情,特率肉圆,将统治权公诸全国,定为共和统领团体,近慰海内厌乱望治之心,远协古圣天下为公之义。鸟头人前经全体公投选举为红茶社长,当兹新旧代谢之际,宜有红茶统一之方,即由鸟头人以全权组织红茶2022学年,与社员协商统一办法,总期人民安堵,海宇乂安,仍合鸟头人、小狐狸、时守宫Elona三人完全领土,为一大红茶动漫社,予与肉圆得以退处宽闲,优游岁月,长受红茶之优礼,亲见郅治之告成,岂不懿欤?钦此。|肉圆退位诏书}}
== 简介 ==
红茶社第二任社长,机器人[[糖浆]]([[糖浆(bot)]])的作者。
(准确来说应该是「半自动化·糖浆」)
== 事迹 ==
=== 编写糖浆机器人 ===
{{main|「半自动化·糖浆」}}
基于go-cqhhtp
曾发生某些奇怪的争议
{{引用|你校动漫社是这样的|鲁迅}}
{{引用|我没有说过这句话|还是鲁迅}}
=== 220813总群关于女权争议 ===
{{main|220813总群关于女权争议}}
369d04fa18a7f6da60ee8edb1c07e9ec9717fff0
模块:Main
828
648
1820
2023-03-18T13:07:35Z
Pio
2
Scribunto
text/plain
--[[
-- This module produces a link to a main article or articles. It implements the
-- template {{main}}.
--
-- If the module is used in category or category talk space, it produces "The
-- main article for this category is xxx". Otherwise, it produces
-- "Main article: xxx".
--]]
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments -- lazily initialise
local p = {}
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local display = args['label ' .. k] or args['l' .. k]
local page = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
pages[#pages + 1] = page
end
end
if #pages == 0 and mw.title.getCurrentTitle().namespace == 0 then
return mHatnote.makeWikitextError(
'no page names specified',
'Template:Main#Errors',
args.category
)
end
local options = {
selfref = args.selfref
}
return p._main(pages, options)
end
function p._main(args, options)
-- Get the list of pages. If no first page was specified we use the current
-- page name.
local currentTitle = mw.title.getCurrentTitle()
if #args == 0 then args = {currentTitle.text} end
local firstPage = string.gsub(args[1], '|.*$', '')
-- Find the pagetype.
local pageType = mHatnote.findNamespaceId(firstPage) == 0 and '条目' or '页面'
-- Make the formatted link text
list = mHatlist.andList(args, true)
-- Build the text.
local isPlural = #args > 1
local mainForm
local curNs = currentTitle.namespace
if (curNs == 14) or (curNs == 15) then --category/talk namespaces
mainForm = isPlural and
'The main %ss for this [[Help:Categories|category]] are %s'
or
'The main %s for this [[Help:Categories|category]] is %s'
else
mainForm = isPlural and '详见这些%s: %s' or '详见%s: %s'
end
local text = string.format(mainForm, pageType, list)
-- Process the options and pass the text to the _rellink function in
-- [[Module:Hatnote]].
options = options or {}
local hnOptions = {
selfref = options.selfref,
icon = 'WikimediaUI-Article-ltr.svg'
}
return mHatnote._hatnote(text, hnOptions)
end
return p
30828fc41b09e550e443259e0f0436147019d92f
模板:Infobox temp/doc
10
764
1936
2023-03-18T13:37:25Z
Pio
2
创建页面,内容为“{{Documentation}} <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> {{t|Infobox temp}} can be used for pages that don't have or require a specific infobox. Please do not use {{t|Infobox}} directly for now as the styles are not defined correctly. This template serves as a temporary replacement of the old Infobox template until the implementation of the Lua infobox is completed. == Syntax == <pre><nowiki> {{Infobox temp |title = |image = |row 1 title = |row…”
wikitext
text/x-wiki
{{Documentation}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{t|Infobox temp}} can be used for pages that don't have or require a specific infobox. Please do not use {{t|Infobox}} directly for now as the styles are not defined correctly. This template serves as a temporary replacement of the old Infobox template until the implementation of the Lua infobox is completed.
== Syntax ==
<pre><nowiki>
{{Infobox temp
|title =
|image =
|row 1 title =
|row 1 info =
|row 2 title =
|row 2 info =
|row 3 title =
|row 3 info =
|row 4 title =
|row 4 info =
|row 5 title =
|row 5 info =
|row 6 title =
|row 6 info =
|row 7 title =
|row 7 info =
|row 8 title =
|row 8 info =
|row 9 title =
|row 9 info =
|row 10 title =
|row 10 info =
|row 11 title =
|row 11 info =
|row 12 title =
|row 12 info =
|row 13 title =
|row 13 info =
|row 14 title =
|row 14 info =
}}
</nowiki></pre>
<noinclude></noinclude>
<includeonly>
<!-- Template catergories go here -->
[[Category:Infobox templates]]
</includeonly>
d26d71adbcd60daaca76842211d9750dab0ae4d0
糖浆
0
509
1672
2023-03-19T02:25:16Z
Pio
2
wikitext
text/x-wiki
{{Infobox
|bodyclass = mw-collapsible floatright
|image1 = [[文件:糖浆立绘2.0.jpg|400px]]
|imagerowclass1 = infobox-image
|header2 = 糖浆
|rowclass2 = infobox-title
|label4 = 短描述
|data4 = 老板娘
|rowclass4 = infobox-subtitle infobox-data infobox-col1
|label5 = 姓名
|data5 = 糖浆
|rowclass5 = infobox-data infobox-col2
|label6 = 性别
|data6 = 女
|rowclass6 = infobox-data infobox-col2
|label7 = 年龄
|data7 = 未知(比[[鵺]]大一点)
|rowclass7 = infobox-data infobox-col1
|header8 = 外貌
|rowclass8 = infobox-header
|label9 = 身高
|data9 = 160cm
|rowclass9 = infobox-data infobox-col2
|label10 = 体重
|data10 = 48kg
|rowclass10 = infobox-data infobox-col2
|label11 = 发色
|data11 = 金发
|rowclass11 = infobox-data infobox-col2
|label12 = 三围
|data12 = 70 59 81
|rowclass12 = infobox-data infobox-col2
|header13 = 其他
|rowclass13 = infobox-header
|label14 = 种族
|data14 = 类人
|rowclass14 = infobox-data infobox-col2
|label15 = 生日
|data15 = 9月19日
|rowclass15 = infobox-data infobox-col2
|label16 = 血型
|data16 = O型
|rowclass16 = infobox-data infobox-col2
|label17 = 星座
|data17 = 处女座
|rowclass17 = infobox-data infobox-col2
|label18 = 萌点
|data18 = 大小姐 金发 [[萝莉]]
|rowclass18 = infobox-data infobox-col2
|label19 = 个人状态
|data19 = 老板娘+服务员
|rowclass19 = infobox-data infobox-col2
|label20 = 相关人
|data20 = [[鵺]]
|rowclass20 = infobox-data infobox-col1
|header99 = {{Template:Infobox_buttons}}
|rowclass99 = infobox-button-bar
}}
[[文件:糖浆立绘2.0.jpg|替代=糖浆立绘|缩略图|糖浆立绘]]
[[文件:糖浆立绘.png|替代=糖浆立绘萝莉版(旧版)|缩略图|糖浆立绘萝莉版(旧版)]]
== 简介 ==
'''糖浆'''(日语:'''(しろっぷ )''')是由'''杭州第二中学钱江学校动漫社'''所创作的世界观《[[红茶project]]》及其衍生作品的登场角色。现在在红茶馆中作为老板娘兼主厨兼创意设计兼采购员。
(人工)提供货源的服务生(原大小姐,幕后掌门人)。脚程很不错,(甚至)可以跨维度的那种。见闻多,想法多,在二楼擅建玩具屋,童心未泯。冒失鬼+LUCKY点满。容易出出人意料但好评如潮的隐藏菜单{{黑幕|(因为太有名所以不管隐藏了)}}。——羊驼
建馆初期独自筹备好一切并开张,建馆后也努力的一人身兼多职,后来鳩的加入使情况有所缓解。
兼茶馆的唯一愿望是喜欢大家都可以开开心心的。她可以什么都不要,就是不允许有人动了她的茶馆。
茶馆的建立不但融洽了陌生人之间是隔阂,也带动了该地区发展。
拥有较强的动手能力,她的创意厨艺其实就是随机混合各种菜品,不过总是幸运地创作了口味优秀菜品。
拥有非常强大的脚力,甚至可以轻松穿越各种无形的结界。
此外,不擅长思考和细致的活。
=== 概括词 ===
无限乐观大小姐
超强脚力
情绪极端
依赖型可爱
== 个人情况 ==
她不存在控制情绪这一说法,也不存在共感他人情绪的说法——她的情绪差不多是个独立体,无规律的变换着。
在过往情绪孤独负面积累下,因果帮助她保持了接近病态的乐观。
除非她被另一种极端的情绪掌控,否则她只会乐观,且不知道乐观是什么。
出于背景原因,希望箱庭里的所有人都可以和睦共处。
===绝赞新皮制作中===
[[文件:4PJ366NX42SIU1N6H6.png|糖浆新皮制作中|300px]]
== 设定槽点 ==
{{Hide
|标题=1.死歌颂在文案部群聊(线上)于2020.12.26做出的糖浆的性格<del>吐槽</del>设定:
|内容=
•糖浆本人我是讲她为人很好的
(羊驼:?你断个句我看不懂)
•反正就糖浆大好人
•但自从来了茶馆
•都开始咸鱼了
}}
{{Hide
|标题=2.死歌颂与小肉圆子儿在文案部群聊(线上)于2020.12.26做出的有关糖浆的三围的<del>胶流</del>设定:
|内容=
•小肉圆子儿:@羊驼 糖浆和鵺的基础属性
•死歌颂:@小肉圆子儿 是店内的人工货源,幕后掌门人,脚程尤其不错(甚至可以跨维度的那种),见闻多,想法多,在其二楼内擅自搭建了个玩具屋,童心未泯,比较冒失和Lucky满分,有容易出乎意料但好评如潮的隐藏菜单(因为太有名了所以不算隐藏了)
•小肉圆子儿:那个打下来了
•小肉圆子儿:基础属性啊啊啊
•小肉圆子儿:就是身高啥的
•死歌颂:是性格还是能力
•死歌颂:嗷这个
•羊驼:你是说三围我还真不好说
•死歌颂:身高163
•羊驼:差不多
•死歌颂:三围
•死歌颂:我女儿我去搜搜
•羊驼:草。
•羊驼:数据请符合实物谢谢
•死歌颂:87.62 61.85 88.91
•死歌颂:对应胸围腰围臀围
•死歌颂:等一下
•羊驼:年龄未知
•羊驼:生日——我想想
•死歌颂:糖浆本人是比较瘦弱的
•死歌颂:你都减一下
•小肉圆子儿:就是bwh吗
•死歌颂:其实我之前计算好了
•死歌颂:她的年龄
•小肉圆子儿:每个减多少
•死歌颂:我对女性三围不太懂。。。
•死歌颂:这是网上搜的
•小肉圆子儿:那就每个减20把
•死歌颂:@羊驼
•小肉圆子儿:她也不懂 (ps.因为之前问过了)
•羊驼:搞得我懂一样
•死歌颂:不至于
•死歌颂:减20人死了
•小肉圆子儿:不会吧
•羊驼:生日9.19
•死歌颂:腰围调59.19
(然后死歌颂就发来一张图<女性三围标准对照表>)(见右)
[[File:糖浆设定参照2.1.jpg|缩略图]]
•死歌颂:身高145腰围都55多
•羊驼:……
•小肉圆子儿:我知道
•羊驼:目瞪口呆.jpg
•小肉圆子儿:腰围不会太小
•死歌颂:@小肉圆子儿 兄弟
•小肉圆子儿:?
•死歌颂:臀围太小了
•死歌颂:这都凹进去了
•小肉圆子儿:o
•小肉圆子儿:67.62 59.19 68.91
•死歌颂:145臀围都超80
•死歌颂:80吧
•死歌颂:80.73
•小肉圆子儿:67.62 59.19 80.73
•死歌颂:163的个子捏148的臀围差不多了
•死歌颂:我发你看一眼
[[File:糖浆设定参照2.2.jpg|缩略图]]
•小肉圆子儿:糖浆还是贫一点吧
•小肉圆子儿:67.62 59.19 80.73
•羊驼:糖浆贫一点
•小肉圆子儿:可以吗
•死歌颂:那67062也太过了
•羊驼:看不懂
•羊驼:你们继续
•死歌颂:72都很平了
•小肉圆子儿:对,太大了
•小肉圆子儿:72很贫?
•死歌颂:你看看嘛
•死歌颂:145都有70多
•死歌颂:考虑高中生
•死歌颂:69或70
•小肉圆子儿:69.62 59.19 80.73
}}
[[分类:金发]][[分类:9月19日]][[分类:O型]][[分类:处女座]]
386f4448ffffef044c86d6cda9d9f06f389c5a53
模板:Main Page/header/doc
10
767
1939
2023-03-19T02:58:23Z
Pio
2
创建页面,内容为“{{Documentation}} [[Main_Page|主页]]的头部模板。”
wikitext
text/x-wiki
{{Documentation}}
[[Main_Page|主页]]的头部模板。
eea5f90bb3bab787c6d2e9b033cd597ce8736f75
模板:Main Page/header/styles.css
10
768
1940
2023-03-19T03:09:58Z
Pio
2
Loli移动页面[[模板:Main page/header/styles.css]]至[[模板:Main Page/header/styles.css]],不留重定向
sanitized-css
text/css
.home-header {
margin-top: -1rem;
margin-bottom: 2rem;
padding-top: 1rem;
}
.home-header__title {
margin-top: 0;
font-size: 1.5rem;
}
.home-header .home-header__subtitle {
margin-top: 0.4rem;
color: var( --color-base--subtle );
font-size: 0.875rem;
}
.home-header__search {
max-width: 600px;
padding: var( --space-sm ) var( --space-md );
margin-top: var( --space-md );
margin-bottom: var( --space-md );
margin-left: auto;
margin-right: auto;
border: 1px solid;
border-color: var( --border-color-base--darker );
border-radius: var( --border-radius--pill );
cursor: pointer;
font-size: 0.875rem;
font-weight: var( --font-weight-medium );
}
.home-header__search:hover {
background-color: var( --background-color-quiet--hover );
}
.home-header__searchIcon img {
margin-right: var( --space-md );
opacity: var( --opacity-icon-base );
}
.home-header__searchText {
vertical-align: middle;
}
.keyboard-text {
padding: 0 5px;
border: 1px solid;
margin: 0 2px;
border-radius: 4px;
}
html.skin-citizen-dark .home-header__searchIcon img {
filter: invert( 1 );
}
@media ( min-width: 682px ) {
.home-header {
text-align: center;
}
}
@media ( hover: none ) {
.desktoponly {
display: none;
}
}
6b02a679145b690911a53034e8d2e8a98b1bd331
模板:Main Page/shared/styles.css
10
769
1941
2023-03-19T03:10:16Z
Pio
2
Loli移动页面[[模板:Main page/shared/styles.css]]至[[模板:Main Page/shared/styles.css]],不留重定向
sanitized-css
text/css
.home-grid {
display: grid;
grid: auto-flow dense/repeat( auto-fit, minmax( 9.375rem, 1fr ) );
grid-auto-rows: minmax( 3rem, auto );
grid-gap: 0.625rem;
}
.home-grid--col2 {
grid-template-columns: 1fr 1fr;
}
.home-grid a.external {
background-image: none;
}
.home-card {
position: relative;
padding: 15px;
background: var( --color-surface-1 );
border-radius: 8px;
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.04 ), 0 3px 6px rgba( 0, 0, 0, 0.0575 );
font-size: 0.875rem;
}
.home-card table.timeline {
margin-top: 0.2rem;
}
.home-card--col2 {
grid-column: span 2;
}
.home-card--row3 {
grid-row: span 3;
}
.home-card--row4 {
grid-row: span 4;
}
.home-card--row8 {
grid-row: span 8 / auto;
}
.home-card__label {
color: var( --color-base--subtle );
font-size: 0.8125rem;
letter-spacing: 0.75px;
}
h3.home-card__header {
margin-top: 0;
font-size: 1rem;
}
.home-card__header a {
display: flex;
align-items: center;
justify-content: space-between;
}
.home-card__header a:after {
content: '▶';
font-size: 0.8125rem;
}
.home-card__background {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: #242a31;
border-radius: 8px;
}
.home-card__background img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.home-card__foreground {
position: absolute;
}
.home-card__foreground .home-card__label {
color: #bababa;
}
.home-card__foreground .home-card__header {
color: #fff;
}
.home-card p {
margin-top: 0.2rem;
font-size: 0.875rem;
}
.home-card.home-card--button {
overflow: hidden;
padding: 0;
background: #242a31;
}
.home-card--button a {
display: flex;
height: 100%;
justify-content: center;
align-items: center;
padding: 0 15px;
background: transparent;
color: #fff;
font-weight: 500;
}
.home-card--button .home-card__background a {
padding: 0;
}
.home-card--button img {
transition: transform 0.2s ease;
}
.home-card--button:hover img {
transform: scale(1.1);
}
.home-link {
display: grid;
margin-top: 6px;
font-size: 0.875rem;
font-weight: 500;
grid-gap: 6px;
text-align: center;
}
.home-link__button {
display: flex;
}
.home-link__button a {
flex-grow: 1;
padding: 0.3rem 0.6rem;
border: 1px solid;
border-color: var( --border-color-base );
background: var( --color-surface-2 );
border-radius: 12px;
color: var( --color-base--emphasized ) !important;
}
.home-link__button a:hover {
background: var( --color-surface-2--hover );
}
.home-link__button a:active {
background: var( --color-surface-2--active );
}
#home-content {
margin-top: 1.6rem;
}
.home-stats {
flex-grow: 1;
line-height: 1;
}
.home-stats__value {
font-size: 1.5rem;
font-weight: 600;
}
.home-stats__unit {
margin-top: 0.2rem;
color: var( --color-base--subtle );
font-size: 0.8125rem;
}
#home-card-discord {
background: #5865f2;
}
#home-card-patreon {
background: #ff424d;
}
#home-card-reddit {
background: #ff4500;
}
.home-footer {
font-size: 0.8125rem;
font-family: monospace;
text-align: center;
}
fe7f0ecd500fe63eef3c17621968f32d637d11bd
文件:WikimediaUI-Search.svg
6
770
1942
2023-03-19T03:14:09Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
模板:Main Page/header
10
766
1938
2023-03-19T03:14:24Z
Pio
2
wikitext
text/x-wiki
<div class="home-header">
<h1 class="home-header__title">欢迎来到红茶维基 [[File:SCW-Verified.svg|20px|link=]]</h1>
<p class="home-header__subtitle">红茶现有[[Special:新建页面|'''{{NUMBEROFARTICLES}}''']]篇条目,[[Special:新建文件|'''{{NUMBEROFFILES}}''']]张图片,[[特殊:Listusers|'''{{NUMBEROFUSERS}}''']]名注册用户,[[特殊:Statistics|'''{{NUMBEROFEDITS}}''']]次编辑。</p>
<div id="skin-citizen-search-trigger" class="home-header__search" role="button"><span class="home-header__searchIcon">[[File:WikimediaUI-Search.svg|16px|link=]]</span><span class="home-header__searchText">点我<span class="desktoponly">或者按下 {{Key press|/}} </span>开始搜索</span></div>
</div><templatestyles src="Template:Main_Page/header/styles.css"/><noinclude><!-- For preview only --><templatestyles src="Template:Main_Page/shared/styles.css" />{{/doc}}</noinclude>
55b879b86a88efe90dd6836371818f841607f5f0
Loli
0
771
1943
2023-03-19T04:08:59Z
Pio
2
重定向页面至[[萝莉]]
wikitext
text/x-wiki
#重定向 [[萝莉]]
66ab8eb380e89e6656ae3b028930efa5cbd49357
红茶维基:版权
4
550
1721
2023-03-19T04:38:05Z
Pio
2
wikitext
text/x-wiki
{{copyfrom|moe|萌娘百科:著作权信息}}
== 著作权信息(通俗版本) ==
文本内容除特殊注明外,均在'''知识共享 署名-非商业性使用-相同方式共享 4.0 中国大陆(CC BY-NC-SA 4.0 CN)许可协议'''下提供,附加条款亦可能应用。
其他类型作品著作权归原作者所有,如有作者授权则遵照授权协议使用。无作者授权协议情况下,以评论,报道为目的,遵照 [https://flk.npc.gov.cn/detail2.html?ZmY4MDgwODE3NTJiN2Q0MzAxNzVlNDc2NmJhYjE1NTc%3D 《中华人民共和国著作权法》]第二十四条、[https://flk.npc.gov.cn/detail.html?ZmY4MDgwODE2ZjNjYmIzYzAxNmY0MTM5OTJiMjFkYjk%3D 《信息网络传播权保护条例》]第六条“合理使用”原则使用,标注来源。
=== 知识共享 署名-非商业性使用-相同方式共享 4.0 中国大陆(CC BY-NC-SA 4.0 CN)许可协议 ===
该项许可协议<ref>协议地址:https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh</ref>规定,只要他人注明您的姓名并在以您的作品为基础创作的新作品上适用同一类型的许可协议,该他人就可基于非商业目的对您的作品重新编排、节选或者以您的作品为基础进行创作。基于您的作品创作的所有新作品都要适用同一类型的许可协议,因此适用该项协议, 则对任何以您的原作为基础创作的演绎作品自然同样都不得进行商业性使用。
=== 署名方法 ===
在转载'''本维基'''中任何内容时必须给出'''原页面的URL链接''',并注明文章(全文,部分)从'''本百科'''转载。
=== 演绎政策 ===
所有在网络上公开发表的,任何人可访问的作品,如作者无明确声明,视为 允许演绎(通俗地讲,允许进行“[[二次创作]]”)
=== 著作权所有者权利 ===
著作权所有者,包括但不限于未将作品著作权部分或全部 转让/出售/放弃 的原作者,通过与作者 协议/购买/继承 获得作品著作权的网站/非营利组织/商业公司/报社/杂志社/个人。我们会在尽可能的情况下以符合著作权所有者所在国的法律与中国著作权相关法律体系下满足著作权所有者的要求。当著作权所有者注册著作权的国家法律与中国法律冲突时,萌百将会优先遵守中国法律。
如著作权所有者已部分或全部将作品授权与红茶维基使用,而后要求进行授权修改或回收(契约修改)。萌百保留有条件接受修改请求/部分接受/拒绝请求的权利。
=== 作者权利 ===
所有作品会尽量按照作者发布作品时指定的作者名进行注释,对一些难以界定作者的或无法取得作者名的(包括放弃署名权)作者一栏将会留空。(多位作者会全部列出)
对于不再持有作品著作权的原作者的要求,萌百方面没有著作权法上的义务进行处理,但原作者提出的要求会尽量满足。与著作权所有者要求冲突时,优先处理著作权所有者的请求。
请不要上载任何原作者并未授权公开的作品(如在QQ上点对点发送的作品,要求注册方可浏览的小众论坛上公布的作品等)(上载此类作品前,务必征得原作者的同意)
'''需注意''':如果原著作权持有者自行将作品上传至某些网站(一般是写有霸王条款的大型简体中文网站比如腾讯,百度,新浪等,以及内容发布站点如U17,pixiv等),可能会导致原著作权持有者失去对此份作品拷贝的一些权利(如禁止转载,禁止二次创作,禁止商业使用等)。对于此类作品,本站会视情况响应原作者的删除或其他要求。但本站不对此种情况负有任何法律责任。
=== 作品的商业使用 ===
任何被''本维基'''收录的作品,原作者依然持有商业使用其作品的权利。
如果您希望商业使用这些被收录的内容,请与所有 参与此作品创作的原作者 和/或 著作权持有者 进行协商。在与所有人达成协议后,方可商业使用。
== 便于理解的官方版本 ==
官方简易解释:https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh
官方协议全文:https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.zh-Hans
“知识共享”不是本许可协议的一方,对本作品不作任何相关保证。“知识共享”不对您或任何其他方的任何损失负责,包括但不限于与本许可相关的直接损失和间接损失。虽然有上述两点,但如果“知识共享”已明确标识自己为许可人,它将承担许可人的全部权利和义务。
除用于向公众表明本作品是依照知识共享公共许可协议(CCPL)授权以外,如未经“知识共享”事先书面同意,任何一方均不得使用“知识共享”(Creative Commons)商标和其他相关商标及标识。任何被允许的使用都必须符合“知识共享”的现行商标使用准则。该准则已在其网站上发布或可应要求随时提供。为避免疑义,本段关于商标的限制性规定不构成本许可之一部分。
您可以通过 https://creativecommons.org/ 联系“知识共享”。|“知识共享”(Creative Commons)声明
== 注释 ==
<references/>
dd91ec55516a423b100cb7ce2ceacf950bbc9152
模板:Copyfrom/doc
10
773
1945
2023-03-19T04:42:46Z
Pio
2
wikitext
text/x-wiki
{{Documentation}}
== 说明 ==
* 参数 1 写来源站点的interwiki zipcode(详见[[Special:Interwiki]]),请尽量提供这个参数。
* 参数 2 写来源页面名称,默认为使用模板页面名称。
比如
<syntaxhighlight line lang="text">
{{Copyfrom|moe|萝莉}}
</syntaxhighlight>
展示为
{{Copyfrom|moe|萝莉}}
而
<syntaxhighlight line lang="text">
{{Copyfrom|moe}}
</syntaxhighlight>
展示为
{{Copyfrom|moe}}
我们不建议
<syntaxhighlight line lang="text">
{{Copyfrom}}
</syntaxhighlight>
不编写来源不符合 [[project:版权|CC 协议]] 相关规定,但如果你'''不得已'''而如此编写,会展示为
{{Copyfrom}}
2f9ec6f53ade153251ec51575aa96b44c57b9fd9
文件:FA-copyright.svg
6
774
1946
2023-03-19T04:46:53Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
模板:Copyfrom
10
772
1944
2023-03-19T04:47:20Z
Pio
2
wikitext
text/x-wiki
<includeonly><!--
Message box
--><div class="mbox mbox-low" role="presentation"><span class="mbox-title"><span class="mbox-icon metadata">[[File:FA-copyright.svg|14px|link=]]</span>这个条目存在内容复制自 {{#if:{{{1|}}}|[[{{{1|}}}:{{{2|{{FULLPAGENAME}}}}}]]|其他维基站点下的页面 {{FULLPAGENAME}}}}。</span>
<div class="mbox-text">这是一个条目,存在从 {{#if:{{{1|}}}|[[{{{1|}}}:{{{2|{{FULLPAGENAME}}}}}]]|其他维基站点}} 复制而来的内容,与我们同样遵循[[project:版权| CC 版权协议]],故在此声明。</div>
</div><!--
TemplateStyles
--><templatestyles src="Template:Mbox/styles.css" /></includeonly><noinclude>
{{/doc}}</noinclude>
fd5ab0a1628cba6137f3546750180943ecdab117
MediaWiki:Sidebar
8
514
1677
2023-03-19T06:12:23Z
Pio
2
wikitext
text/x-wiki
* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* 特殊
** Special:ArticlesHome|所有文章
** Special:CreateBlogPost|撰写文章
** Special:TimeMachine|时光回溯
** Special:ContributionScores|贡献分数
* 关于
** project:关于|关于本站
** project:版权|版权政策
** project:繁简|繁简政策
3a76544f0a095f9b56dd5b5ffc2de468e9393b8d
红茶维基:繁简
4
775
1947
2023-03-19T07:15:27Z
Pio
2
wikitext
text/x-wiki
{{copyfrom|wikipedia|Help:中文维基百科的繁简、地区词处理}}
'''繁簡處理'''是[[Mediawikiwiki:mediawiki|Mediawiki]]的自動轉換,目的是以电脑程序適應不同用字模式的差異。
中文維基百科的讀者和編者來自世界各地。他們所需求或貢獻的中文在性質上有許許多多的差異,像是簡化字和繁体字的差異、各地区詞彙的差異、方言差異造成的书面語言的差異等等。MediaWiki將這些中文性質集合在一起,稱為「用字模式」。可以說:一種用字模式就是某些中文性質的一個集合。為了整合讀者和編者多元的資源,也為了促進各方的交流,本百科並不規範讀者或編者要使用何種用字模式,而是嘗試以電腦程式的自動轉換來適應這些差異,讓編者可以以自己的用字習慣提供資料,也讓讀者可以選擇所要的資料的用字遣詞。因此編輯和閱讀中文維基百科時有特別的事項需要注意。事實上,就連本頁嘗試說明的事項,也有許多模糊之處。
用字模式自動轉換與MediaWiki系統本身的原理有關。大部分編者輸入系統的文章內容,包括文字和維基語法等等,在此稱為源碼。維基系統通常會保留完整不變的源碼,不作自動轉換。讀者使用維基系統時,並非直接閱讀源碼,而是由系統將源碼即時自動轉換成合適的形式,例如加上圖片、超链接等等。而中文维基百科的用字模式轉換就是眾多自動轉換程序中的一道。自動轉換電腦程式的能力範圍不只是百科的條目文章,也包括頁面分類等等頁面。
大多數時候(預設情況),維基程序根據轉換表轉換。有時則根據編者在源碼指定的方式自動轉換,包括不轉換或是所謂「人手轉換」。轉換表就是一份列出各種不同用字模式之間,字與字或是詞與詞之間的對應關係的表格。目前只有管理員能編輯轉換表。所謂「人手轉換」仍然是維基系統在讀者使用時即時作的自動轉換,但是這時程序是根據編者在源碼中指定的方式為優先。編者可以在編輯存檔後切換至其他用字模式查看情況。
==用字模式選擇==
目前中文百科系统支持中文的zh(中文用字)、zh-hant(正體/繁體用字)、zh-tw(台灣用字)、zh-hk(香港用字)、zh-mo(澳門用字),以及zh-hans(簡體用字)、zh-cn(中國大陸用字)、zh-sg(新加坡用字)、zh-my(馬來西亞用字)九種'''用字模式'''。不過,目前中文維基百科只啟用了zh-tw(台灣用字)、zh-hk(香港用字)、zh-mo(澳門用字)、zh-sg(新加坡用字)、zh-my(馬來西亞用字)和zh-cn(中國大陸用字)等六種模式。zh(中文用字,即不转换)、zh-hant(繁體用字)、zh-hans(簡體用字)三種模式主要用於維護。zh-my(馬來西亞用字)原被zh-sg(新加坡用字)所涵蓋,於2018年正式拆分啟用;zh-mo(澳門用字)原有zh-hk(香港用字)涵蓋,於2013年正式拆分啟用。要支援更多的用字模式需要修改-{zh-tw:程式;zh-cn:程序;}-,如果有實際需要請在討論頁中提出。
文章主体正(繁)體/简体选择(按优先级):
*已登入用戶可在[[Special:参数设置|个人偏好]]选择不同的中文語言;
*匿名用户可選擇浏览器语言,系統會根据選擇设置,詳见此处;
*如果以上設定都没有,则預設不轉換。
另外,不同-{zh-tw:外觀;zh-cn:皮肤}-(Skin)都增加了到各個用字模式的链接,如現在的 Citizen 面板,連結是在頁面討論頁連結旁,使用下拉選單選擇。以前的 Vector 面板链接則是在文章右上方。链接名称可以通过[[MediaWiki:variantname-zh-tw/zh-cn]]、[[MediaWiki:variantname-zh-tw/zh-tw]]等修改。
===界面用字模式===
界面用字模式是独立于文章内容的用字模式。除了中文各種用字模式,还可以选择英文、法文等等语言。界面用字模式在已登入用戶的个人偏好裡设置。
==转换技术==
技术上,维基百科的字词转换有四层:其一是MediaWiki内置的转换表phab:source/mediawiki/browse/master/languages/data/ZhConversion.php,供各维基计划全域转换;其二是MediaWiki:Conversiontable定义的繁简和地区词转换表,供中文维基百科本地全局转换;其三是各[[wikipedia:Wikipedia字詞轉換處理/公共轉換組|公共转换组]],供主题领域相同和相似的条目统一转换;其四是各条目内设置人手转换,供该条目单独使用。其中,公共转换组和条目内人手转换人人均可编辑,而修改本地转换表则需管理员权限,修改全域转换表須向MediaWiki版本库提交代码。如欲新增或修复全域及本地全局转换,一般用户无法处理。
===转换表===
目前,系统預設的自动转换是根據數個'''「轉換表」'''。轉換表就是一份表格,記載各種不同用字模式之間,字與字或是詞與詞之間的對應關係。又叫'''系统默认转换表'''。目前只有管理員能編輯定制轉換表,一般人可以向管理員提出申請。
===系统默认转换表===
系统默认的转换表在MediaWiki程序中:phab:source/mediawiki/browse/master/languages/data/ZhConversion.php<br>参见[[wikipedia:Wikipedia简繁一多对应校验表]]及[[wikipedia:Wikipedia繁简一多对应校验表]]。
===定制转换表===
'''管理员'''可在Mediawiki:Conversiontable/zh-hans,Mediawiki:Conversiontable/zh-hant,Mediawiki:Conversiontable/zh-cn,Mediawiki:Conversiontable/zh-tw,Mediawiki:Conversiontable/zh-sg,及Mediawiki:Conversiontable/zh-hk-{A|zh:定制; zh-hans:定制; zh-tw:自訂}-转换表。普通用户无法处理。定制转换表可用来修正系统-{zh-hans:默认;zh-hant:預設}-转换表的错误。这些页面可以-{zh:象; zh-hans:象; zh-hant:像}-其他页面一样编写,但是描述转换关系須依以下格式:
<nowiki>
皇后 => 皇后;
波斯尼亚 => 波士尼亞;
萨拉热窝 => 塞拉耶佛 // Sarajevo 的</nowiki>-{zh-hans:翻译; zh-hant:翻譯}-<nowiki>;
...
</nowiki>
为方便显示,每条对应前可加星号(*)或井号(#),可用“//”加写注释,注意每条转换关系要以“;”终止。
Conversiontable/zh-cn页面用于向zh-cn的转换,Conversiontable/zh-tw页面用于向zh-tw的转换,等等。
这些页面更新后,效果并不一定会即时显示出来,因为有些页面可能放在頁面-{zh-hans:缓存; zh-hant:暫存區}-裡。要看即时效果可以用编辑预览功能。
===<nowiki>-{}-</nowiki>标记===
例如:“張國榮曾在英國-{zh:利兹;zh-hans:利兹;zh-hk:列斯;zh-tw:里茲}-大学學習。”所用的-{}-标记是<nowiki>[[利兹大學|-{zh:利兹;zh-hans:利兹;zh-hk:列斯;zh-tw:里茲}-大学]]</nowiki>
參見本頁「[[#常用的轉換工具語法|防止自动转换一段文字的标签]]」。
<nowiki>-{}-</nowiki>标记现可完整转换链接、模板、图像。
===源碼一般不轉換===
大部分編者輸入系統的文章內容,包括文字和維基語法等等,在此稱為'''源碼'''。維基系統通常會保留完整不變的源碼,不會自動轉換源碼。
==斷詞問題——自動轉換程式常見的問題==
'''注意:中文维基百科不保证用字模式自動轉換程式和内容的準确度。用字模式自動轉換並不一定正確,甚至可以說是各種自動轉換中問題最多的。'''
转换程序用最简单的“最大匹配法”來转换,会导致以下错误:假设转换表有一对应关系为
-{R|内存}- => -{R|記憶體}-
现转换以下句子
-{R|人体'''内存'''在很多微生物}-
基于最大匹配,系统会转换“-{内存}-”,得到“-{記憶體}-”。整个句子将会被错误地转换成
-{R|人體'''記憶體'''在很多微生物}-
解决这个问题的根本方法是用智能的-{A|zh:斷詞;zh-hans:分词;zh-hant:斷詞;}-匹配,将上述句子先拆分为
-{R|人体 内 存在 很多 微生物}-
然后再单独转换每个词。
在有這種智能的斷詞系统出現前有两种方法修正上述错误:
#人手将涉及斷詞错误的词分开:人体内<nowiki>-{}-</nowiki>存在很多微生物
#将涉及斷詞错误的多个词作为整体加到定制转换表裡,如“-{体内存在}- => -{體內存在}-”。(註:目前只有管理員能編輯轉換表,一般人可以向管理員提出申請。)
這就是斷詞的錯誤。閱讀本百科時請多加-{}-注意。遇到可疑的部分可以前往編輯頁面去查源碼,或是多多留意不同用字模式之間的轉換關係,以養成自行「反轉換」的能力。
==控制自动转换的代码==
出于特殊的需要,可以用以下的語法設定'''不自動转换''',或是'''「人手转换」'''。
設定了所謂「人手轉換」,其實維基系統仍然會在閱讀者使用時根據系统-{zh-cn:默认;zh-tw:預設}-转换表作自動轉換,但是這時系統還會根據編者在-{zh-cn:源码;zh-tw:原始碼}-中指定(增添)的方式作轉換,並且將編者的方式優先排在转换表所列出的方式之前。也就是由編者自行增添轉換方式。
===常用的轉換工具語法===
{{Main|wikipedia:Help:高級字詞轉換語法}}
*'''防止自動轉換一段文字的標籤''':
*:<code><nowiki>-{文字}-</nowiki></code>
*::效果:-{文字}-
*:对于<code><nowiki>-{}-</nowiki></code>中的文字为转换规则(如“zh:中文”),但又希望保持原样,可以用:
*:<code><nowiki>-{R|文字}-</nowiki></code>
*::效果:-{R|文字}-
*'''防止自動轉換一段文字整体的標籤''':
*:<code><nowiki>文-{}-字</nowiki></code>
*:但分隔在<nowiki>-{}-</nowiki>两侧的文字仍會轉換。簡單來說是切断文字,分别转换。
*:可用于希望保留地区词用法但依然转换简繁的场合,通过打断词语使全局转换规则不能识别希望保留的地区词。
*:效果:
*::繁體:<nowiki>舊-{}-金山,香港稱-{三藩市}-。</nowiki>
*::簡體:<nowiki>旧-{}-金山,香港称-{三藩市}-。</nowiki>
*'''人手轉換一段文字的標籤'''(局部自行增添轉換方式標籤):
*:<code><nowiki>-{zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-</nowiki></code>
*::效果:-{zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-
*'''全文人手轉換標籤'''(全面自行增添轉換方式標籤):
*:<code><nowiki>-{A|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-</nowiki></code>
*::效果:-{A|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-
*'''隐藏式全文人手轉換標籤'''(全面自行增添轉換方式標籤):
*:<code><nowiki>-{H|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-</nowiki></code>
*::效果:-{H|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-文字1
*'''全文人手删除轉換標籤'''(从全局转换表中删除某个规则,在该页面中不再以该规则转换):
*:<code><nowiki>-{-|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-</nowiki></code>
*::效果:-{-|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-文字1
*'''條目標題人手轉換標籤''':
*:<code><nowiki>-{T|文字}-</nowiki></code>
*:或
*:<code><nowiki>-{T|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-</nowiki></code>
*'''轉換規則描述標籤'''(將該規則用人易讀的方式顯示出來):
*:<code><nowiki>-{D|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-</nowiki></code>
*::效果:-{D|zh:文字1;zh-hans:文字2;zh-hant:文字3;zh-cn:文字4;zh-tw:文字5;zh-hk:文字6;zh-sg:文字7;zh-mo:文字8;}-
*'''用字模式名稱標籤'''(將某種語言的代碼轉換成文字描述):
*:<code><nowiki>-{N|</nowiki>{{int:Conversionname}}}-</code>
*::效果:-{N|{{int:Conversionname}}}-
*'''僅轉換指定语言''':
*:<code><nowiki>-{zh-hans;zh-hant|文字}-</nowiki></code>
*::效果:-{zh-hans;zh-hant|文字}-
*:若為zh-hans;zh-hant則顯示轉換後的<code>文字</code>,否則單純顯示不轉換的<code>文字</code>。有沿溯<small>(fallback)</small>的限制,MediaWiki 1.15新增功能。此功能可用于需要避免地区词转换,但允许繁简转换的场合。
*'''全文停用自動轉換''':
*:<code><nowiki>__NOCC__</nowiki></code>或<code><nowiki>__NOCONTENTCONVERT__</nowiki></code>
*'''條目標題停用自動轉換''':
*:<code><nowiki>__NOTC__</nowiki>或<nowiki>__NOTITLECONVERT__</nowiki></code>
====條目標題====
有时文章标题不需要转换,如維基詞典裡的单字,或《计-{}-算机世界报》之类的专有名词。在这情况下,可以在文中加<code><nowiki>__NOTC__</nowiki></code>或<code><nowiki>__NOTITLECONVERT__</nowiki></code>(注意前后都是两道下划线)来防止转换标题。然而,在中文维基百科,由于可能的简繁不同体问题(如“-{计算机世界报}-”和“-{計算機世界報}-”),我们不推荐使用这两个标签,而推荐使用下文中的“<code><nowiki>-{T|}-</nowiki></code>”转换。
<font color="red">注意:</font>这标记應放在文章開頭。
此外,MediaWiki支持全站停用标题转换。某个wiki站点要停用所有的标题转换(但启用正文转换),可在LocalSettings.php中设置<code>$wgDisableTitleConversion = True;</code>。
有时一篇文章的标题裡,可能含有各地區認知不同或翻譯方式差異很大的辭彙,但因為某些理由不適合透過修改转换表來達成自动转换的目的,通常是因為一些常用字。如果贸然修改轉換表,可能會造成更多地方產生錯誤。这种情况下可以有两种方法处理,我们推荐后一种:
#在文章内使用标题转换来指明标题的正确显示:<code><nowiki>-{T|标题}-</nowiki></code>或<code><nowiki>-{T|zh:中文用字; zh-hans:简体用字; zh-sg:新加坡用字}-</nowiki></code>。
#在文章内使用全文人手转换:<code><nowiki>-{A|标题}-</nowiki></code>或<code><nowiki>-{A|zh:中文用字; zh-hans:简体用字; zh-sg:新加坡用字}-</nowiki></code>。
實例:美國政治家John Kerry分別有「-{约翰·克里}-」、「-{約翰·凱利}-」與「-{約翰·克里}-」的不同譯名,但如果在轉換表中互換「-{克里<=>凱利}-」,那麼歐洲地名“克-{里}-米亞”與“克-{里}-姆林宮”將會變成「-{凱利}-米亞」與「-{凱利}-姆林宮」的錯誤情況,為了避免製造更多的混亂,這情況比較適合在[[约翰·克里|-{zh-hans:约翰·克里;zh-hk:約翰·凱利;zh-tw:約翰·克里;}-]]的條目中以人手轉換標籤修正標題與內文部份的相關譯名。
<font color="red">注意:</font>该标记仅仅是指明文章显示时对标题的转换,而不能自动处理链接时的转换。所以使用该标记时切记要通过'''重定向'''将各种用字模式的同一标题指向该文章。如約翰·凱利。
====全文停用自動轉換====
有时通篇文章都需要不转换,例如讨论繁体/简体的文章。在这情况下,可在文中加<code><nowiki>__NOCC__</nowiki></code>或<code><nowiki>__NOCONTENTCONVERT__</nowiki></code>(注意前后都是两條底线)来防止转换内容。不过,在中文维基百科,为了便于各地读者阅读,我们不建议禁止除字词转换相关页面以外页面的全文自动转换。
<font color="red">注意:</font>这标记要放在文章开頭。
==自動轉換的能力範圍==
本百科很多頁面都可自動轉換。但是仍有很多例外。例如最近更新頁面[[Special:Recentchanges]]這樣的特殊頁面,就有一部分是不轉換的。
參見[[wikipedia:Wikipedia什麼是條目]]。
===頁面分類===
目前自動轉換電腦程式的能力範圍不只是百科的條目文章,也包括頁面分類等等頁面。因此除非特別指定,否則條目標題或是子分類標題的分類是根據經過自動轉換之後的'''結果'''來分類。然而在此的自動轉換和別處不同,僅僅是簡單的「繁簡轉換」,並沒有進一步轉換。
===軟體問題===
2006年1月開始出現一個問題,可能與新版本的MediaWiki有關。只要是分類名繁體對簡體,條目或子分類就會從母分類消失,但是條目或子分類頁經過任何編輯之後又會恢復,但系統下一次的链接更新時又會消失。另外,分類是不可使用重定向功能的。
參看:[[wikipedia:Wikipedia页面分类|頁面分類]]。
这一问题已在2009年2月修复,但分类仍不可使用重定向功能。
===內部連結、URL、重定向與搜索===
雖然源碼一般不做轉換。只有程序產生出來的頁面有經過轉換。然而讀者收到的頁面上,在維基系統之內的「內部連結」(不是外部連結或普通的URL,參見Help:链接),並不是由源碼決定,是由程序影響。
===如何建立繁簡重定向頁===
{{main|Wikipedia:重定向#中文繁簡體問題}}
-{zh-hans:登录;zh-hant:登入}-的用戶可以使用移動頁面功能建立繁簡重定向頁。比方說,假設現在有名為「-{沈阳市}-」的條目,而你想建立從「-{瀋陽市}-」到「-{沈阳市}-」的重定向頁就要移動兩次:
#將「-{沈阳市}-」移動到「-{瀋陽市}-」。
#將「-{瀋陽市}-」移動到「-{沈阳市}-」。
其結果將是「-{沈阳市}-」的條目維持原狀,而「-{瀋陽市}-」成為指向「-{沈阳市}-」的重定向頁。
第二次移動看似多-{zh-cn:余;zh-tw:餘}-,但會帶來兩個好處:
*對該條目歷來參與者的尊重——未經討論貿然改變條目名稱是[[wikipedia:Wikipedia方針與指引|不恰當行為]]。
*一旦條目名稱改變,原本指向該條目的連結雖會以重定向的方式指向正確的條目,但長期來說所有重定向連結都應該用直接連結取代。修改所有這些連結會增加維基百科的維護成本(尤其是其他語言的維基百科也有可能透過跨語言連結連向這些頁面),比起此種額外負擔,將條目保持原有名稱會是更有效率的作法。
==編輯一般文章時的注意事項==
*若無正當理由,請勿將文中繁體轉成簡體,反之亦然,這種操作屬於繁簡破壞!
<font color="red">'''请注意:若您的浏览器安装了等繁简转换软件或可以中文繁简转换的移动应用程序,请在编辑时将其关闭或移除。'''</font>
*'''避免繁簡混雜、或以繁/簡體打出簡/繁體用詞''',文章內容及標題(包括分類標題)必須全簡體或繁體,否則可能不會正確轉換,如「-{中國历史}-」(正确写法为“-{中国历史}-”或「-{中國歷史}-」)和「-{操作系統}-」(正确写法为「-{作業系統}-」或“-{操作系统}-”)。如果為單純繁簡轉換(如前者),尚可能成功;但若為使用繁體文字打出簡體詞彙(如後者),則轉換通常註定失敗。尤其後者的情況基本上屬於繁簡破壞的一種。因此,除非十分瞭解繁簡差異,否則在編輯極易出現繁簡差異的條目(例如電腦相關的條目)時,請簡體中文使用者不要使用繁體字錄入、繁體中文使用者不要使用簡體字錄入。
*以前許多事物有繁簡兩版本的不同文章來介紹。現在需要人手將這些文章合併起來。具體請参看[[wikipedia:Wikipedia繁簡處理]]。
*當須建立繁簡重定向頁的時候,建立新條目的方式往往無法奏效,這時請參考[[wikipedia:Wikipedia重定向#中文繁簡體問題]]。
c410109b8667f5fb240a57f5814a637e7798ba01
模板:Lang
10
776
1948
2023-03-19T07:30:59Z
Pio
2
创建页面,内容为“<includeonly><span lang="{{{1}}}" xml:lang="{{{1}}}">{{{2}}}</span>{{#switch:{{{1|}}} |ar |fa |he = ‎ |#default = }}</includeonly><noinclude>{{/doc}}</noinclude>”
wikitext
text/x-wiki
<includeonly><span lang="{{{1}}}" xml:lang="{{{1}}}">{{{2}}}</span>{{#switch:{{{1|}}}
|ar
|fa
|he = ‎
|#default = }}</includeonly><noinclude>{{/doc}}</noinclude>
ad1b713f13d8f9383f333cdca4f65335b0a5ed47
模板:Lang/doc
10
777
1949
2023-03-19T07:31:26Z
Pio
2
创建页面,内容为“{{Documentation}} 语言模板”
wikitext
text/x-wiki
{{Documentation}}
语言模板
867c4eea2c72e1242ba18ad2a6366da942018637
模板:引文
10
778
1950
2023-03-19T07:34:48Z
Pio
2
重定向页面至[[Template:引用]]
wikitext
text/x-wiki
#REDIRECT [[Template:引用]]
ac980c1cf7f1fab664ba30a1ada65bc0c17cf45e
文件:Doubleloli.jpg
6
779
1951
2023-03-19T07:44:23Z
Pio
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
文件:國之將亡 必有蘿莉.jpg
6
780
1952
2023-03-19T07:46:17Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
文件:蘿莉柯博文.jpg
6
781
1953
2023-03-19T07:46:18Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
文件:Img2748.png
6
782
1954
2023-03-19T07:59:46Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
文件:Img14407.jpg
6
783
1955
2023-03-19T08:09:16Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
萝莉有三好
0
785
1957
2023-03-19T08:14:51Z
Pio
2
重定向页面至[[萝莉有三好,身娇腰柔易推倒]]
wikitext
text/x-wiki
#REDIRECT [[萝莉有三好,身娇腰柔易推倒]]
47ec3e220190663a8f40b2fb0ca0b96ae28c5915
身娇腰柔易推倒
0
786
1958
2023-03-19T08:14:59Z
Pio
2
重定向页面至[[萝莉有三好,身娇腰柔易推倒]]
wikitext
text/x-wiki
#REDIRECT [[萝莉有三好,身娇腰柔易推倒]]
47ec3e220190663a8f40b2fb0ca0b96ae28c5915
网上流传满分高考作文揭秘 书刊主编否认收录
0
787
1959
2023-03-19T08:42:11Z
Pio
2
wikitext
text/x-wiki
新华网浙江频道2月25日电 据《青年时报》报道,一篇名为《行走在消逝中》、内容取材于日本动漫的作文近日在网上引起争议,因为这篇作文被打上了2007年“浙江高考满分作文”的标记。不少网友认为该篇作文有“情色”成分,而且内容让人看不大懂,诸多质疑的声音发问:如此作文真的可以被打满分吗?记者日前联系上2007年浙江高考语文阅卷大组组长、浙江大学人文学院中文系教授陈建新。2007浙江高考作文的阅卷工作是由陈教授负责的。陈教授仔细回忆了去年得满分的高考作文,并且慎重地向语文大组几位老师求证,大家一致否定这篇网上的文章是浙江考生的满分作文。“我们有严格的规定,任何高考作文一律不能被私自带出去,更不能擅自发表。如果有人这样做,是要追究责任的。对于外界看到的所谓高考满分作文,我们一律不予承认。”陈建新表示,说得严重一点,这是对浙江考生的侮辱,浙江考生的满分作文哪会写得这么烂?
调查 作文集主编否认收录“满分作文”
这篇所谓的高考满分作文,开头第一句就是:谨以此文献给那些依然坚定地为着伟大的“宅”事业而奋斗的有名的和无名的宅人们。内容取自日本动漫及游戏,通篇充斥着“Loli”、“more”、“御姐”、“萝丽”、“萌”、“抚子”等陌生词汇。
这样一篇文章,之所以被传为2007年浙江高考满分作文,是因为有人称该文收录在一本名为《2007高考满分作文范卷》的读物上,并有图片为证。
上周五,记者联系上了《2007高考满分作文范卷》的主编徐增才。他很肯定地说,自己去年7月主编的该读物上,并没有收录这样的作文。
“这样的作文,一眼就会被否决的,根本不可能成为满分作文,更不可能被我们收录。”身为山东某中学语文老师的徐增才说,他看过网上的读物照片,与自己主编的《2007年高考满分作文范卷》在排版上完全不同。所以,他猜测这是一次无聊的网络炒作。
如果真的有考生在高考时写了这样的文章,会得高分吗?
著名儿童文学作家、浙江省少年作家协会副会长赵冰波看了这篇作文,第一反应就是:这是一篇非常概念化的作文,如果被打了满分,那是值得推敲的,赵冰波认为,这篇文章“用比较文学性的抒情的语言,转述了某某游戏的设定,比较概念化,仅此而已。”
而陈建新教授对这篇作文的评价是:语言晦涩,隐约表达了成长的意思,但是写得很不理想,让人看不懂。这篇作文如果放在高考中,分数肯定是打不高的。
命题 以人文理念为核心
据了解,高考的命题是非常严格的,命题的老师在出题期间基本上“与世隔绝”,往家里打个电话都要录音。
在命题的时候,命题老师一般会考虑到三个因素:命题要有利于中学教学,有利于高校选拔,有利于考生发挥写作水平,要给考生写作的空间。
从题目的角度来说,题目要具有文化味、文学性,要体现浙江文化的底蕴,要有丰富的人文内涵,要人文性强。实际操作中,一个题目的拟出要经过很多次讨论,至少需要一个月以上的时间。
命题组成员一般由高校代表、教师代表、教研代表等组成,会有五六位左右。除了命题组,还设置审题组。一道高考作文的命题要经过一道道关才能最终确定。
2007年6月8日晚,我省高考一结束,浙江教育考试院便组织高考命题组专家和一批一线教师,第一时间解读了出题思路,并对试卷进行了权威点评。
在语文卷的命题思路中,专家们提到:
从2004年我省自主命题以来,作文的话题内涵均以人文理念为核心,2007年作文的话题是“行走在消逝中”,这个话题既延续了近三年来作文题的核心内涵,使我省作文命题的人文理念形成体系,具有理论化、系列化特征。
一线语文教师对作文题的点评也指出:
(这一作文命题)特别强调落实“文中有我(人)”,要求考生充分体现自我。无论是在作文材料里还是在提示语中,都集中突出一个“你”字,如“你的童年”“你有何感想”“你自己或身边”“你的真情实感”“你的思想观点”等,这样的明确指向和反复提醒在高考命题中前所未有。
评分 标准要经过讨论
当考生第一次看到作文题目的时候,作为阅卷老师的陈建新等人也是第一次看到作文题目。怎么制定一个合理的打分标准,怎样合理地进行打分,这一系列工作就随之紧张开始了。
首先要有个判断,题目大致希望考生写什么样的作文?拿2007年的高考作文题目《行走在消逝中》来说,行走,指的是时下、当下、现实生活,消逝指的是过去、历史。对考生来讲,这就需要在审题、立意上有准确的把握。
陈建新介绍,评分标准不会制定得非常详细,不会说给立意准确打5分啊,给语言优美打5分啊,不会制定这种分项打分。评分标准主要是从内容和形式两方面把握,内容方面比如审题、立意,形式方面比如说语言、结构。
一起制定这个初步标准的通常有四五位老师,除了语文阅卷大组组长即陈建新,还会有省教育组成员、杭州市重点中学的语文教研室主任、省教委的人员及浙大中文系的老师。他们要开会共同讨论确定初步标准。
除了这个标准,他们还要从考生作文中抽出15份左右的试卷,通常要拉开档次,比如50多分、40多分、30多分,各打一个分数。这些样卷打印出来,还要从中选2篇“讨论稿”。等阅卷老师到来后,组织各个阅卷组的组长再在一起进行讨论,有时候会做适当调整,之后打分标准才最终确定下来。
陈建新介绍,全部阅卷的老师会在800位上下,其中有一半也就是400位左右的老师会批阅作文。等老师们到来后,要对他们进行统一培训,尽可能地把标准引向统一,尽可能消除对打分标准把握不准的情况。
在时间的安排上大致是这样:8日、9日做些准备工作,比如评分标准的初步制定;10日,阅卷老师进场,当天要组织阅卷组长讨论评分标准并最终确定下来。11日,对阅卷老师进行培训。基本上11日下午开始阅卷。阅卷过程会有10天左右,基本上20日、21日阅卷结束。22日就要公布分数。
满分 要通过阅卷大组审查
跟某些作文比赛中评委一票通过的打分程序不同,高考作文的打分程序相对复杂得多。这几年都负责浙江高考作文阅卷的陈建新,也曾多次担任过征文比赛的评委,之所以后者的评分慎之又慎,重要原因还是高考作文直接关系到考生的前途命运。
在近几年的浙江高考作文阅卷中,通常采用“背靠背”打分,一篇作文第一个老师打过分后,还会由第二个老师重新打个分。打分都在电脑上操作,所以每个老师都无法看到别人的打分。
每一篇作文都要至少经过两位老师的“背靠背”打分,如果两个分数比较接近,数据库会自动把两个分数相加除以2,得出的分数就是考生的分数。如果两位老师打的分数距离太大,数据库会自动把作文提交给第三位老师,第三位老师通常是作文组里经验丰富的老师,之后电脑自动匹配相近的分数。如果第三位老师打出的分数还是距离太远,那就会被作为“有分歧的作文”,要经过语文大组的终审。
陈建新介绍,所有参与作文阅卷的老师,会被分成将近20个组,一个组20个人上下,每个组有2个组长,由资历高、阅卷丰富的高校中文系老师或高中老师担任,对本组的阅卷进行复核、调剂。
除此之外,在阅卷进行三四天之后,作为语文阅卷大组组长,陈建新会在阅卷老师中再抽出四五个打分准确、经验丰富的老师组成语文大组,主要进行三项工作:抽查、审查有分歧的作文,审查高分作文。
陈建新说,基本上50分以上都非常慎重,58、59、60这三个分数基本都是要审查的。尤其是满分作文,是必须要经过阅卷大组审查的。而陈建新作为语文阅卷大组组长,每一篇满分作文必须要亲自看过。满分作文通常每年有10-20篇左右。
因为作文的主观性太强,因此整个打分程序比较复杂。陈建新说,这个工作他做了几年,他认为这个打分程序是比较科学、合理的。对考生来说是公平、公正的。
审查 满分可能变零分
“批高考作文时,我是没有打过满分的。因为打上满分的作文,送上去审了之后,常常会改判,甚至可能会变零分。”一位连续几年都参加了高考语文作文阅卷工作的老师私下透露说,所以他不想让考生“冒险”。
他告诉记者,去年批作文卷时,有一篇题为《吊李白赋——续》的考生作文,是用赋的形式写的,不仅文章写得好,而且字也写得很漂亮,参与初评的一位研究生打了满分送上去审,结果,阅卷大组审查后,判定为零分,理由是“文体不符合”,因为高考作文规定不能写诗歌。这一判定,令那位研究生非常难过,当即与阅卷大组争论了起来,并急得落下了眼泪。但阅卷大组最终并没有改变判分。
除了这篇文章外,他记得还有一篇送审的满分作文也被改判了零分。原因是,为了防止考生背诵他人文章进行抄袭,凡是送审的满分作文,都会有人上网搜索,结果这篇作文就被发现与网上一篇博客文章的内容一致。
不过,该阅卷老师表示,考生在作文中引用一些网络语言、舶来语,并不会影响判分,至少就他本人来说,这些语言是一些新鲜元素,反而能为考生作文加分。
但是,类似网上流传的那篇作文,他认为,就不可能得高分了,因为这种让人看不太懂、有些莫名其妙的作文,肯定不能算是好作文。
两个问题 高考作文怎样能得到高分?
2008年高考马上又要开始了,怎样才能在高考中拿到高分,这是考生都关注的问题。陈建新说,高考作文的打分是对语言、结构、立意深浅等方面的一个综合考评,在高考作文中能够打高分的作文,肯定要做到最基本的要求:语言明朗,表情达意,文字流畅。
文无定法。但是作文一定要“我手写我心”,考生应用自己的笔表达真情实感,考生应用自己的眼睛来看这个世界,用自己的头脑来思考。
陈建新强调,高考的满分作文并不都是无懈可击的,在短短的时间内写出一篇完美的文章很难,但是写出能打动人的好文章是可以做到的。
而那些“三段论”、“套话式”的作文,是肯定打不了高分的。陈建新说,不管什么时候,那种作文都是对考生成绩的一种伤害。
有着多年阅卷经验的老师提醒说,虽然近年来,高考作文都是话题作文,文体也都放开了,给了考生很大的发挥空间,标新立异是好事,但是,考生在寻求结构和形式上创新的同时,千万不要太过出格,写过于怪异的作文也可能是冒险的行为,还是应该在语言上多下些工夫。
另外,他还透露说,在高考作文中,考生应尽量避免举“三巨头”的例子,“三巨头”是指李白、陶渊明和屈原。因为这三个人的例子已经太耳熟能详了,所以不能体现考生的语文积累,也就很难得高分了。
如何看待流传的满分作文?
对于网上流传的满分作文,参与阅卷的老师分析说,按照规定,浙江的高考满分作文是保密的,不能公开的,一些满分作文连我们阅卷老师都没看过。所以,外界流传的满分作文不具备真实性,那些打着“高考满分作文”旗号的读物,也很可能是滥竽充数的,学生们应谨防上当。
对此,去年参加高考的女生陈倩觉得,学生还是有能力辨别所谓满分作文的优劣的。根据估算,她的高考作文分在50分以上。她说:“虽然打上了高考满分作文的标记,但我们还是会有自己的判断,有些文章一看就觉得不可能得满分。”陈倩说,她看高考满分作文,主要是学习别人如何切入话题的,因为现在都是话题作文,一开始的导入需要找切口,切得巧妙与否直接影响到整篇作文的好坏。
陈建新教授说,一些作文集可以参考,但更重要的是平时看些好文章。他建议学生们多读读那些真正的名家名篇。作者: 张向芳 郭婧
b2dbb7bc0e5c69eb695604ac44c85e234621146e
文件:Img16904.jpg
6
788
1960
2023-03-19T08:54:02Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
文件:Img16903.jpg
6
789
1961
2023-03-19T08:54:03Z
Pio
2
基于MsUpload的文件上传
wikitext
text/x-wiki
基于MsUpload的文件上传
a13cb97e12beb36c5e09351cbbe1d01f12e99668
行走在消逝中
0
790
1962
2023-03-19T09:04:38Z
Pio
2
wikitext
text/x-wiki
{{copyfrom|rekowiki|行走在消逝中}}{{copyfrom|uncyclopedia|行走在消逝中}}{{引文|[[蘿莉|Loli]]有三好,身嬌腰柔易[[推倒]]|本文对蘿莉的頌讚}}
==简介==
'''{{PAGENAME}}''',是因2007年[[高考]]而生的蘿莉控典範作文(遠超過学考的考題)。
==解說==
*中國浙江2007年高考作文題
*某考生以此作了一篇宅向的惡搞文,有人指出已確定獲得浙江當年高考作文滿分,但沒有相關證據,並且在中國網路社群引起"喧"然大波,事實上官方已經出來講沒有滿分文了<ref>网上流传满分高考作文揭秘 书刊主编否认收录 https://www.zj.xinhuanet.com/newscenter/2008-02/25/content_12536947.htm (已被消除),[[网上流传满分高考作文揭秘_书刊主编否认收录|本站点对其的备份]]</ref>。
**就常識而言,這篇別說是拿滿分,根本就是不可能不拿零分的,完全是神資源回收物
**但在ACG界,這篇文章肯定為萬年滿分,被後世所傳頌
**此被視為青少年已經逐漸宅化的證據之一
*文章第一句「[[蘿莉有三好,身嬌腰柔易推倒|loli有三好,身嬌腰柔易推倒]]」十分精闢,極易上口,實在是千錘百煉之作
*文學價值可能跟蘿莉塔有拼
*跟[[超越夢想一起飛]]同樣出自浙江,中國國際動漫節也是在浙江杭州舉行,證明浙江果然人傑地靈
==變成高考範文==
*因為一些不明原因出現在中國高考作文參考書;這本實際上也並非聲稱的那本參考書,排版和格式都完全不同。
*證據:
<gallery>
file:
file:Img16904.jpg
</gallery>
*最令人囧掉的還是書上的點評:
*:陌生的故事,更增加了文章的可讀性。
*:本文的最為成功的地方就是取材獨特,以網絡遊戲中的故事來闡釋對「行走在消逝中」的感悟和理解,主人公在蛻變中或者時間的消逝中走向生命的另一種形式,這個主旨具有深刻的現實意義。作者顯然是一位網絡遊戲愛好者,或者是一位喜歡看仙俠小說的同學,能夠把自己所長巧妙地嫁接到高考作文中,這是值得肯定的。
*編者竟然把蘿莉和網絡遊戲、仙俠小說等扯上關係,實在是厲害{{黑幕|又腦殘到了極點}}。
==重點句子==
*[[蘿莉有三好,身嬌腰柔易推倒|loli有三好,身嬌腰柔易推倒]]
*一部以萬年正太為主角的經典名著中寫道:「每當一個loli說『我不相信小妖精』的時候,就有一個小妖精死去。」
**該「經典名著」指蘇格蘭小說家及劇作家詹姆斯·馬修·巴利(James Matthew Barrie,1860年——1937)所著之《彼得潘》。
**原文為 "Every time a child says 'I don't believe in fairies' there is a little fairy somewhere that falls down dead."
*天下為攻,世界大同
*如果沒有去年的花落,哪會有第二年的花開?沒有loli的凋零,哪有御姐和熟女的嫵媚微笑?
*loli是萌的,但只有loli的世界是不萌的
*朝拜御姐,暮推蘿麗。春引熟女,冬誘人妻
==相關惡搞==
[[File:Img14407.jpg|center]]
==內文==
——loli有三好,身嬌腰柔易推倒——
''(謹以此文獻給那些依然堅定地為著偉大的「宅」事業而奮鬥的有名的和無名的宅人們。)''
「小小失敗不過沒關係;不管怎樣反正都會有辦法的。無論什麼要求我都願侍奉主人。『主人想做什麼就做什麼吧』……」
不知怎的,我的腦海中忽然想起這首耳熟能詳的旋律。雖然也知道現在可不是悠閒的時候,但是不自覺地,我停下筆,暫時止住了試卷上的龍飛鳳舞。
「已經……夏天了呢。」陽光毫不吝嗇地傳遞著夏日的氣息,我心中生出這樣的莫名感嘆。
是阿,已經夏天了呢。已經到了Loli們用她們可愛的粉唇吸吮著混雜白色汁液,或許會被打上重重馬賽克的棍狀物的時候了呢。
元氣型的Loli們不會被燭焰般的炙熱推倒,她們永遠充滿了那樣的朝氣。無論是穿著深色連身泳裝,還是隨時會露出底下那可疑的小熊圖案的清涼短裙,她們身上那股被稱為『萌』的光芒總是比太陽更耀眼,更吸引人們的眼睛。
這,是「moe的季節」呢。
可是……可是阿,為什麼在這樣的時刻,我卻止不住來自心底的那一陣陣失落呢?
春華秋實,在怎樣美麗的花朵,都有結出果實的那一天——更何況,那一朵朵欲開害羞的嬌嫩花苞。相比之下,她們的存在時間,更是短得令人落淚。
一部以萬年正太為主角的經典名著中寫道:「每當一個loli說『我不相信小妖精』的時候,就有一個小妖精死去。」
作者沒有寫下去。每當loli們用她們已經不再柔軟的語音認真地說出「不再相信妖精」的時候,她們作為loli的一生也已經宣告結束。而脫去了稚氣的loli,便如退去了顏色的花朵,將以肉眼看得見的速度枯萎,凋謝。
想到不久的將來,loli們或許會成為口中高呼「天下為攻,世界大同」的腐女;抑或成為形容枯槁的歐巴桑,為青菜一毛還是兩毛的問題爭論半天,任何人都不忍去看,有著多麼美麗的笑容的那一隻隻萌力四射的活潑小loli呵
花開花落。每一年,都有一批loli蛻化成為乙女,向著御姐和人妻邁出無可挽回的一步。她們走了,如櫻花的落瓣一樣,在燦爛中消逝。那樣美麗,又那樣令人心碎。
除了心碎,我又能如何呢?
就如同改變不了熵總是在增大這一事實一樣,時間總是不知不覺地從我們身邊走過——在走過的同時,無聲而無情地一點點取走,那所謂「萌」的光環……
但是,但是……
如果沒有去年的花落,哪會有第二年的花開?沒有loli的凋零,哪有御姐和熟女的嫵媚微笑?
時間固然帶走了萌萌的loli,但在同時,他又帶給了這些(前)loli們更多種萌的可能性。
loli是萌的,但只有loli的世界是不萌的。僅看到loli的成長,而忽略了三無、撫子等唯御姐以上級別方能具備的萌要素,更不符合代表最廣大宅人群中利益的全控系宅人的一貫方針。
朝拜御姐,暮推蘿莉。春引熟女,冬誘人妻。
在未能身體力行這一系列萌之境界之前,氣餒是被我等所謂宅之接班人所不齒的。
心中燃起了不輸於蠟滴的滾燙慾火,繼續走下去的願望在此刻無比強烈。
或許,明天你已不再。但我仍將微笑。
微笑著,欣賞loli的消逝,微笑著,展開懷抱,迎接更加和諧的一天。
==文學價值==
===優良文句===
'''''「loli有三好,身嬌腰柔易推倒」'''''
:論:其以loli,來代替「[[蘿莉]]」一詞,相當的簡潔、明快,且符合魯迅等有新思維之哲學家的去漢字化,改拉丁化(縱使用日文,也不如歐美先進)。
:將此句和全文相比,著實簡潔點出了蘿莉控的心裡。其成就水平,甚超過《[[蘿莉塔]]》,將蘿莉控情結這種新世界的思想,更加推上一層樓。
'''''「但是不自覺地,我停下筆,暫時止住了試卷上的龍飛鳳舞」'''''
:評:本文作者,其在試卷上龍飛鳳舞,可見其行文速度逼近[[光速]](因為龍和鳳,在中國人心中是具有「神」力的動物,故速度可從心所想),是應試效率的典範,可給中國眾多莘莘學子效法。
:而根據上文,其因想到[[冥土]],故受到主人式的加持,而此文勇奪滿分。堪為中國千萬同胞,最先進的一群--御宅族的師法典範。
===總論===
{{note|此處是有意留空的,本範本只是用來告訴你這一點,這一切都不是幻覺!還在這裏發呆幹啥?醒醒吧阿宅!}}
==點評之價值==
{{note|此處是有意留空的,本範本只是用來告訴你這一點,這一切都不是幻覺!還在這裏發呆幹啥?醒醒吧阿宅!}}
===讚頌===
{{note|此處是有意留空的,本範本只是用來告訴你這一點,這一切都不是幻覺!還在這裏發呆幹啥?醒醒吧阿宅!}}
91610b88b3b9f10239afb45e6b86573ded9d9e6d
萝莉有三好,身娇腰柔易推倒
0
784
1956
2023-03-19T09:08:52Z
Pio
2
wikitext
text/x-wiki
{{copyfrom|moe|萝莉有三好,身娇腰柔易推倒}}{{copyfrom|rekowiki|成句/蘿莉有三好,身嬌腰柔易推倒}}
[[File:Img2748.png|center]]
[[File:Img16903.jpg|thumb|page1]]
[[File:Img16904.jpg|thumb|page2]]
==简介==
'''萝莉有三好,身娇腰柔易推倒'''是出自浙江2007年高考作文题《行走在消逝中》一篇范文中的成句,某考生以此题目作了一篇的恶搞文,文章第一句便是'''萝莉有三好,身娇腰柔易推倒''',随后有人指出该文章已确定获得浙江当年高考作文满分。
当然,谁都知道这不可能是真的,事实上官方已经表明没有满分作文了<ref>网上流传满分高考作文揭秘 书刊主编否认收录 https://www.zj.xinhuanet.com/newscenter/2008-02/25/content_12536947.htm (已被消除),[[网上流传满分高考作文揭秘_书刊主编否认收录|本站点对其的备份]]</ref>,并且官方也明确表示此文为造假。因为相关规定,任何高考作文都不得私自带出或擅自发表,且这样的作文无疑不会得到高分。<del>但有谁在乎呢?</del>在二次元圈内,这篇文章被肯定为万年满分{{黑幕|被萝莉控占领的世界}},被后世所传颂。尤其第一句十分精辟,朗朗上口,流芳千古,经久不衰。
==解說==
*中國高考範文《[[行走在消逝中]]》的第一句。
*已衍生出大量作品。
*事實上這已經被證明是假消息
*圖片中的文章的格式和該書名的書的格式完全不同
*一年的滿分範文只有幾篇,但會經過多人閱卷才能有滿分,初閱滿分往往到上頭就變零分,所以改卷員大都不會給滿分。這也做成不可能只有一篇評語的狀況。
[[File:Img14407.jpg|center]]
==用法==
*高考作文時。(零分保證)
*人家問[[蘿莉]]有甚麼好時。
*當[[蘿莉]]問你她自己有甚麼優點時。
==原始出处==
这句话实际是上人民群众耳熟能详的地方宣传用语“东北有三宝,人参,貂皮,乌拉草”的变体。
==全文==
===题目===
还记得你的童年吗?随着年龄的增长和思想的成熟,那些美丽的梦想、单纯的快乐似乎在一步步离我们远去。
苍茫的丛林间,玛雅文化湮没了;丝绸古道上,高昌古国消逝了。人类在消逝中进步。行走在消逝中,既有「流水落花春去也」的怅惘,也有「谁道人生无再少」的旷达……
读了上面这段文字,你有何感想?请以「行走在消逝中」为话题写一篇作文,可讲述你自己或身边的故事,抒发你的真情实感,也可以阐明你的思想观点。
————浙江省2007年高考作文题
===原文===
'''提示:本段包含性暗示相关描述;阅读时有可能产生轻微不适感;请确信自己已满当地法律许可年龄且心智成熟后再来阅览。'''
<poem>
——Loli有三好,身娇腰柔易推倒——
(谨以此文献给那些依然坚定地为着伟大的“[[宅]]”事业而奋斗的有名的和无名的宅人们。)
「小小失败不过没关系;不管怎样反正都会有办法的。无论什么要求我都愿侍奉主人。『主人想做什么就做什么吧』……」
不知怎的,我的脑海中忽然想起这首耳熟能详的旋律。虽然也知道现在可不是悠闲的时候,但是不自觉地,我停下笔,暂时止住了试卷上的龙飞凤舞。
「已经……夏天了呢。」阳光毫不吝啬地传递着夏日的气息,我心中生出这样的莫名感叹。
是阿,已经夏天了呢。已经到了Loli们用她们可爱的粉唇吸吮着混杂[[长森牛乳|白色汁液]],或许会被打上重重马赛克的棍状物的时候了呢。元气型的Loli们不会被烛焰般的炙热推倒,她们永远充满了那样的朝气。无论是穿着深色连身泳装,还是随时会露出底下那可疑的小熊图案的清凉短裙,她们身上那股被称为『萌』的光芒总是比太阳更耀眼,更吸引人们的眼睛。
这,是「moe的季节」呢。
可是……可是阿,为什么在这样的时刻,我却止不住来自心底的那一阵阵失落呢?
春华秋实,在怎样美丽的花朵,都有结出果实的那一天——更何况,那一朵朵欲开害羞的娇嫩花苞。相比之下,她们的存在时间,更是短得令人落泪。
一部以万年正太为主角的经典名著<ref>《彼得潘》(Peter Pan)</ref>中写道:「每当一个Loli说『我不相信小妖精』的时候,就有一个小妖精死去。」<ref>原文为 "Every time a child says 'I don't believe in fairies' there is a little fairy somewhere that falls down dead."</ref>
作者没有写下去。每当Loli们用她们已经不再柔软的语音认真地说出「不再相信妖精」的时候,她们作为Loli的一生也已经宣告结束。而脱去了稚气的Loli,便如退去了颜色的花朵,将以肉眼看得见的速度枯萎,凋谢。想到不久的将来,Loli们或许会成为口中高呼「天下为攻,世界大同」的[[腐女]];抑或成为形容枯槁的[[欧巴桑]],为青菜一毛还是两毛的问题争论半天,任何人都不忍去看,有着多么美丽的笑容的那一只只萌力四射的活泼小Loli呵。
花开花落。每一年,都有一批Loli蜕化成为[[乙女(萌属性)|乙女]],向着[[御姐]]和[[人妻]]迈出无可挽回的一步。她们走了,如樱花的落瓣一样,在灿烂中消逝。那样美丽,又那样令人心碎。
除了心碎,我又能如何呢?
就如同改变不了熵总是在增大这一事实一样,时间总是不知不觉地从我们身边走过——在走过的同时,无声而无情地一点点取走,那所谓「[[萌]]」的光环……
但是,但是……
如果没有去年的花落,哪会有第二年的花开?没有loli的凋零,哪有御姐和[[熟女]]的妩媚微笑?
时间固然带走了萌萌的Loli,但在同时,他又带给了这些(前)Loli们更多种萌的可能性。
Loli是萌的,但只有Loli的世界是不萌的。仅看到Loli的成长,而忽略了[[三无]]、[[大和抚子|抚子]]等唯御姐以上级别方能具备的萌要素,更不符合代表最广大宅人群中利益的全控系宅人的一贯方针。
朝拜[[御姐]],暮推[[萝莉]]。春引[[熟女]],冬诱[[人妻]]。
在未能身体力行这一系列萌之境界之前,气馁是被我等所谓宅之接班人所不齿的。
心中燃起了不输于蜡滴的滚烫欲火,继续走下去的愿望在此刻无比强烈。
或许,明天你已不再。但我仍将微笑。
微笑着,欣赏Loli的消逝,微笑着,展开怀抱,迎接更加[[河蟹娘|和谐]]的一天。
</poem>
==高考范文==
虽然这篇作文高考满分事件纯属虚构,但却的的确确因为一些不明原因,出现在某中国高考作文参考书中。[[File:Img16903.jpg|thumb]]
而最令人诧异的莫过于书中的精彩点评。
{{Hide|标题=精彩点评
|内容=本文的最为成功的地方就是取材独特,以网络游戏中的故事来阐释对「行走在消逝中」的感悟和理解,主人公在蜕变中或者时间的消逝中走向生命的另一种形式,这个主旨具有深刻的现实意义。作者显然是一位网络游戏爱好者,或者是一位喜欢看仙侠小说的同学,能够把自己所长巧妙地嫁接到高考作文中,这是值得肯定的。
{{黑幕|呵呵}}
{{黑幕|玩赛啰}}
[[File:Img16904.jpg|250px|center]]
}}
==关于将推倒萝莉赋予实践的注意事项==
值得注意的是,“身娇腰柔易推倒”一词是混合了喜爱与懵懂性欲的,用来娱乐的玩笑性质话语。其行为和对象都仅限于虚拟空间。请区分玩梗和现实的区别,以免招来不明所以者不必要的误解。
{{Hide|标题=如果你真的推倒了一个身娇腰柔的萝莉,那么|内容=
*<span style="color:red"><b>中华人民共和国刑法第二百三十六条第二款规定:“奸淫不满十四周岁的幼女的,以强奸论,从重处罚。”在司法解释中,凡与未满14周岁的女子发生性关系,不论该女子是否自愿,都属于强奸罪。也就是说中国的刑法“幼女”概念指不满14周岁的女性。
:罗翔教授:「相对刑事责任人在幼女同意的情况下偶尔和幼女发生关系,这个不认为是犯罪。我们把它称之为青梅竹马的辩护理由。」,如该视频:[https://www.bilibili.com/video/av85046844 我国刑法对幼女定义14岁以下 是高了还是低了(罗翔教授讲性犯罪)]中“一个15岁的男孩和一个13岁的幼女发生关系”的例子。<br><br>
*台湾地区法律是要求合理证明自己的确不知对方未满14周岁并且双方合意则不是犯罪。<br><br>
*香港地区刑法将“幼女”年龄规定为不满16周岁。若与该幼女发生性关系,会被控“与未成年少女发生性行为罪”,俗称“衰十一”。<br><br>
*在日本,刑法将“幼女”年龄规定为不满12周岁。</span></b>
}}
== 文献 ==
<references />
448421a53e2c900a1827b19d4feb9830479cd294
用户:Loli
2
519
1682
2023-03-19T09:13:10Z
Pio
2
wikitext
text/x-wiki
[[文件:8350C84E-FD64-4C66-8417-CD14A63E0136.jpeg|缩略图]]
网管,是萝莉控。
網站管理員,是蘿莉控。
Webmaster, also a lolicon.
Webサイト管理者、ロリコン。
== 杂项 ==
* [[:分类:用户Loli的文章|我的文章]]
* [[User:Loli/sandbox]]
* [[User:Loli/old_vector.css]]
* [[User:Loli/vector_2022.css]]
733c4a06cc025bbe992974120efce5dd0ddd9dc6
Main Page
0
501
1663
2023-03-23T10:49:21Z
Pio
2
wikitext
text/x-wiki
__NOTOC__<!--css-->{{#css:
.mw-editsection{
display:none;
}
.mw-body-header{
display:none;
}
.home-header__title {
margin-top: 0;
font-size: 1.5rem;
}
.home-header {
text-align: center;
}
}}<!--END-->{{Main_Page/header}}
== 你要来杯红茶吗 ==
===人设===
<div style="column-count:3">
*[[糖浆]]
*[[鵺]]
*[[杰茜]]
*[[洛基]]
</div>
===人员===
<div style="column-count:3">
*[[小火龙]]
*[[肉圆]]
*[[羊驼]]
*[[酸柠萌]]
*[[时守宫Elona]]
*[[火华子]]
*[[鸟头人]]
</div>
=== 萌属性 ===
<div style="column-count:3">
*[[萝莉]]
</div>
== 新闻栏 ==
* [[2023井上添花]]活动
* [[2022换届]]事项
3914f32bf2845587510346c59c6622f1928d8f1e
MediaWiki:Common.css
8
557
1728
2023-03-23T10:52:42Z
Pio
2
css
text/css
/* 这里放置的CSS将应用于所有皮肤 */
/* 这里放置的CSS将应用于移动版网站 */
/* 黑幕 */
.heimu, .heimu a, a .heimu, .heimu a.new {
background-color: #252525;
color: #252525;
text-shadow: none;
}
.heimu:hover, .heimu:active,
.heimu:hover .heimu, .heimu:active .heimu {
color: white !important;
}
.heimu:hover a, a:hover .heimu,
.heimu:active a, a:active .heimu {
color: lightblue !important;
}
.heimu:hover .new, .heimu .new:hover, .new:hover .heimu,
.heimu:active .new, .heimu .new:active, .new:active .heimu {
color: #BA0000 !important;
}
/* 划掉 */
#bodyContent del{
text-decoration:line-through;
color:#A9A9A9;
}
/* 隐藏编辑章节 */
.mw-editsection{
display:none;
}
#siteSub{
display:none;
}
/* 标题特别样式 */
h3 .mw-headline:before{
content: "#";
color: #ff6d6d;
font-size: 1.25rem;
margin-right: .25em;
}
h2 .mw-headline::after {
content:"¶";
position: absolute;
color: #ff6d6d;
font-family: 'Merriweather Sans',Helvetica,Tahoma,Arial,'PingFang SC','Hiragino Sans GB','Microsoft Yahei','WenQuanYi Micro Hei',sans-serif;
padding-left: .5em;
font-size: 1.5rem;
}
/* 语言转换无计数 */
#citizen-languages__buttonCheckbox:after{
display:none !important;
}
b916ef19f5bc0ebe184472cc20b843497eee9081
鵺
0
525
1696
2023-03-24T11:20:04Z
Pio
2
wikitext
text/x-wiki
{{Infobox temp
|title = 鵺
|image = 鵺立绘.png
|row 1 title = 性别
|row 1 info = 女
|row 2 title = 年龄
|row 2 info = 未知,比[[糖浆]]小一点
|row 3 title = 身高
|row 3 info = 155cm
|row 4 title = 体重
|row 4 info = 45kg
|row 5 title = 发色
|row 5 info = 白毛
|row 6 title = 种族
|row 6 info = 类人
|row 7 title = 来源地
|row 7 info = 地球
|row 8 title = 妈妈
|row 8 info = 不愿透露姓名的小王
|row 9 title = 萌属性
|row 9 info = [[白毛]] [[萝莉]]
}}
== 简介 ==
8d02ea663bec0b5a2cbc66ceb073e5b861a2c97d
模板:Infobox temp
10
763
1935
2023-03-26T03:58:58Z
Pio
2
wikitext
text/x-wiki
<!--
Infobox
--><includeonly>{{Infobox|
|bodyclass = mw-collapsible floatright
|bodystyle = padding-bottom:20px;
|image1 = {{#if:{{{image|}}}|[[File:{{{image}}}|400px]]|[[File:Placeholderv2.png|400px]]}}
|imagerowclass1 = infobox-image
|header1 = {{{title|}}}
|rowclass1 = infobox-title
|label2 = {{{row 1 title|}}}
|data2 = {{{row 1 info|}}}
|rowclass2 = infobox-data infobox-nocol
|label3 = {{{row 2 title|}}}
|data3 = {{{row 2 info|}}}
|rowclass3 = infobox-data infobox-nocol
|label4 = {{{row 3 title|}}}
|data4 = {{{row 3 info|}}}
|rowclass4 = infobox-data infobox-nocol
|label5 = {{{row 4 title|}}}
|data5 = {{{row 4 info|}}}
|rowclass5 = infobox-data infobox-nocol
|label6 = {{{row 5 title|}}}
|data6 = {{{row 5 info|}}}
|rowclass6 = infobox-data infobox-nocol
|label7 = {{{row 6 title|}}}
|data7 = {{{row 6 info|}}}
|rowclass7 = infobox-data infobox-nocol
|label8 = {{{row 7 title|}}}
|data8 = {{{row 7 info|}}}
|rowclass8 = infobox-data infobox-nocol
|label9 = {{{row 8 title|}}}
|data9 = {{{row 8 info|}}}
|rowclass9 = infobox-data infobox-nocol
|label10 = {{{row 9 title|}}}
|data10 = {{{row 9 info|}}}
|rowclass10 = infobox-data infobox-nocol
|label11 = {{{row 10 title|}}}
|data11 = {{{row 10 info|}}}
|rowclass11 = infobox-data infobox-nocol
|label12 = {{{row 11 title|}}}
|data12 = {{{row 11 info|}}}
|rowclass12 = infobox-data infobox-nocol
|label13 = {{{row 12 title|}}}
|data13 = {{{row 12 info|}}}
|rowclass13 = infobox-data infobox-nocol
|label14 = {{{row 13 title|}}}
|data14 = {{{row 13 info|}}}
|rowclass14 = infobox-data infobox-nocol
|label15 = {{{row 14 title|}}}
|data15 = {{{row 14 info|}}}
|rowclass15 = infobox-data infobox-nocol
}}</includeonly><noinclude>
{{/doc}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
dd2a0ed55d388656cdcedc9f170b8b43fd629416
模板:Documentation
10
585
1757
2023-03-26T03:59:50Z
Pio
2
wikitext
text/x-wiki
<includeonly>{{#invoke:Documentation|doc}}__NOEDITSECTION__</includeonly><noinclude>{{/doc}}</noinclude>
291285b6f733c3a1739fbe7be41323bda485a2ba
萝莉
0
765
1937
2023-03-26T04:03:49Z
Pio
2
wikitext
text/x-wiki
{{copyfrom|komica|蘿莉}}{{copyfrom|uncyclopedia|蘿莉}}{{copyfrom|moe|萝莉}}{{note|本条目欢迎有<del>[[萝莉控]]倾向</del>兴趣的朋友加以补完。}}
[[file:doubleloli.jpg|thumb|两只萝莉]]
[[file:糖浆立绘.png|thumb|看板娘也是萝莉]]
[[file:蘿莉柯博文.jpg|thumb|一隻典型的蘿莉,想必身為讀者的[[你]],已經被她給萌上了。]]
[[file:國之將亡_必有蘿莉.jpg|thumb|孫中山對蘿莉的評價。(有個字還寫錯了)]]
{{引用|真是的,小學生真是太棒了!!|[[小學生真是太棒了|语句]]出自《[[萝球社]]》}}
{{引文|果然是你吧,那個把我萌殺的蘿莉?|對蘿莉說這番話的[[正太]]}}
{{引文|極度過敏反應!!!|[[鈦]]对蘿莉的怒吼}}
{{引文|回答我,什麼是蘿莉?|萌君十二恨}}
{{引文|少女的肌膚,是[[上帝]]的傑作!|劉泰英}}
{{引文|[[中子發射器]],發射!|[[鈹]]对蘿莉的怒吼}}
{{引文|[[好孩子]],[[哥哥]]請你吃[[棒棒糖]]!|怪叔叔}}
{{引文|[[推倒]]、推倒、推倒,通通推倒!|[[蘿莉控]]們的妄想}}
{{引文|國之將亡,必有蘿莉。|鐵拳無敵孫中山}}
{{引文|[[蘿莉]]?那是一個沉睡的[[萌]]女。讓她去睡吧!因為她一旦醒來,她將會震撼世界!|拿破輪}}
{{引文|為[[蘿莉]]捨命,[[阿宅]]的[[愛心]]沒有更甚於此的。 |聖經}}
{{引文|蘿莉有三好:身嬌、腰柔、易推倒!|[[萝莉有三好|语句]]来自[[行走在消逝中|浙江2007年高考作文滿分文(假的)]]}}
{{引文|希望蘿莉永遠不要長高!|拂櫻齋主}}
{{引文|蘿莉無限好,只是近御姐!!|李商隱}}
{{引文|[[3.14159|3141]]年是世界末日…蘿莉的天下|馬雅人}}
{{引文|謝啦|蘿莉对馬雅人表达感謝}}
==简介==
'''蘿莉'''(學名:'''''lolitas''''',外語俗名:'''Roli''',日語俗名:'''{{lang|ja|ロリ}}''')為[[美少女]]的一個亞種,表面上看似年紀約4到12歲的小[[妹妹]],其裝可愛+[[貧乳]]的姿態最受[[阿宅]]歡迎。基本上,[[蘿莉控|全球一半多一點點的男性]]都會喜歡蘿莉。
=== 萝莉的年龄 ===
参考小说局限于现实的设定,早期对萝莉所引申出的年龄定义一般是指“高于9岁,低于16岁的女孩”(而低于9岁者,则称“[[幼女]]”或“[[小萝莉]]”)。从学校阶段来看,因萝莉通常介于小学高年级到初中的阶段,亦称“半青少女”。
而后来,随着萝莉概念的逐渐幼化倾向,12-16岁阶段的女孩有一部分已经归为[[乙女(萌属性)|乙女]],原先部分算作[[幼女]]的年龄逐渐被归入萝莉。
新世纪以来随着营养条件大大改善后,女性初潮/青春期时间都有明显提前,年龄标准是不准确的。同时由于幼化风潮的影响,加之软件内容协会以及日本映画伦理委员会等机构要求'''成人内容'''出场人物必须在十八岁以上,这使得作品中角色形象是幼女(未成年)的角色被硬说为已满18岁,萝莉一词对年龄上的限制已变得非常宽泛。但与幼化倾向不符的,[[合法萝莉]]一词因''某些法律''的出台而被发明。
=== 萝莉的体型 ===
由于在ACG作品中,人物年龄段与身体形态不必保持一致(并且不一致因内容审查原因被再次加强)。画个萝莉甚至幼女硬说已有18岁以上的情况泛滥成灾。尤其是对于设定中非人类的种族,年龄可能在几百岁、几千岁、几万岁甚至更大。
按照人类的年龄段界定萝莉已不再适用了,而是只要身体的外部形态(例如头身比等)与人类6-19岁年龄段女孩相当,便可以看作是萝莉。因此,也有年龄相当大、但身体仍是萝莉形态的萝莉,从而又诞生了“[[伪萝莉]]”、“[[万年萝莉]]”等名词。
“萝莉”一词并非代表“未发育”或“初发育”,也有[[童颜巨乳]]型的萝莉。误认为萝莉一定为[[贫乳]]是典型的刻板印象。幼齿才是所有萝莉的共通点。
按照此种分类方法,身高范围在130至160厘米之间,头身比在四至六之间<ref>[http://www.npa.go.jp/safetylife/syonen29/6-siryou4.pdf 在日本发售的萝莉系十八禁游戏作品的角色外观不可在五头身以下({{lj|「キャラクターの見た目が、5頭身以下の場合、NGとなります。」}})]</ref>,面相幼齿的女性角色即可归入萝莉范畴。
=== 现实中的萝莉 ===
通常“萝莉”在ACG圈内仅用于指代'''二次元世界中的萝莉'''。现实当中的“萝莉”,其判断标准常被质疑。“是看身材长相来判断,还是年龄来分层?”如果依据年龄,由于个体成长的速度不一,同年龄女生外观和心智都会有巨大差异,而且现实中的萝莉从性格等方面上与二次元中有很大差距<s>,很多都还是熊孩子</s>。如果依据外观判断,皮嫩脸美身材娇小的女性,在ACG界只会用于可爱的女孩子,而在现实中却可能被用于形容装嫩“大妈”。
[[三次元]]媒体,特别是所谓时尚媒体会滥用“萝莉”一词来形容一些模特,这通常会引起ACG爱好者的反感。
需要说明的是,“推倒萝莉”一词是混合了喜爱与懵懂的欲望的,用来娱乐的玩笑性质话语。其行为和对象都仅限于虚拟空间。请区分玩梗和现实的区别,以免招致不必要的误解。
{{Hide|标题=如果你真的推倒了萝莉,那么……|内容=
*中华人民共和国刑法第二百三十六条第二款规定:“奸淫不满十四周岁的幼女的,以强奸论,从重处罚。”在司法解释中,凡与未满14周岁的女子发生性关系,不论该女子是否自愿,都属于强奸罪。也就是说中国的刑法“幼女”概念指不满14周岁的女性。<ref>罗翔教授:「相对刑事责任人在幼女同意的情况下偶尔和幼女发生关系,这个不认为是犯罪。我们把它称之为青梅竹马的辩护理由」,如该视频:[https://www.bilibili.com/video/av85046844 我国刑法对幼女定义14岁以下 是高了还是低了(罗翔教授讲性犯罪)]中“一个15岁的男孩和一个13岁的幼女发生关系”的例子。</ref>
*台湾地区法律是要求合理证明自己的确不知对方未满14周岁并且双方合意则不是犯罪。
*香港地区刑法将“幼女”年龄规定为不满16周岁。若与该幼女发生性关系,会被控“与未成年少女发生性行为罪”,俗称“衰十一”。
*在日本,刑法将“幼女”年龄规定为不满12周岁。
}}
=== 萝莉幼化倾向 ===
正如上文所提到的,随着流行风向的改变,萝莉一词的定义变得越来越宽泛。
在现今ACG界,萝莉已不再像以前明确界定年龄(9岁以上,16岁以下),而是演化为所谓的只要幼小可爱就能称之为萝莉。过去(2000年—2008年期间)意义上的部分'''[[幼女]]''',到了21世纪10年代初,已经改称为萝莉,而过去意义上的较大年龄的萝莉现在多被形容为'''[[乙女(萌属性)|乙女]]'''或'''[[美少女]]'''。但目前也有忽略乙女,将乙女的范围也涵盖萝莉内,仅仅分为萝莉(未成年人)和御姐(成年人)两种组别的说法。
例如《[[萝球社!]]》中的[[袴田日向]]按照体型特征在过去应该被归为[[幼女]],而现在却被广泛地当作萝莉或[[小萝莉]]来对待。
另外,由于ACG作品中的人物画风近几年在愈发幼化,所以可以看到处在初中、高中、大学甚至更后阶段的普通人类女性角色也往往一副萝莉形态。比如《[[魔法老师]]》的漫画越往后人物越“幼化”。以至于让人对比开篇和结尾有种“大家都是越活越年轻了呀”的感觉。
<del>为什么?因为[[萝莉有三好,身娇腰柔易推倒]]!</del>
== 具有本属性的典型角色 ==
* [[糖浆]]
* [[鵺]]
==解說==
*宅話,泛指8~14歲的小女孩。
**看起來像也可以算。
*[[萌屬性]]的一種,已經非常[[普通|普遍]]。
**在[[ACG]]裡,有著純潔、任人擺佈、年輕等既有形象。
**但也有蘿莉角色塑造是藉著反其道而行來營造[[ギャップ萌え|反差萌]]。
*從「蘿莉塔(Lolita)」省略而來。
*語源為俄羅斯裔美國作家伏拉塔米爾·那博科夫(Владимир Владимирович Набоков / Vladimir Vladimirovich Nabokov)所寫的同名文學作品,內容為描述一名中年男子對一名十二歲少女一見鍾情的故事。
**該作品在納波科夫六十歲完成後備受爭議,但是也受到主流學術界推崇,曾于1959年1月爬升《纽约时报》畅销书目单第一位。
***1962年出品的改編電影曾於台灣上映,由史丹利·庫柏利克執導,片名譯作「一樹梨花壓海棠」。
***1997年再次被翻拍為電影,由艾崔恩·林恩執導,而扮演蘿莉塔的多明妮克·史旺,當時15歲也造成了話題。
===蘿莉控(Lolita Complex或Lolicon、ロリコン)===
*指喜歡蘿莉的人。
**Complex一字原為精神醫學用語,指情意綜、癖好、症候群、性傾向,被引申為對某種事物之喜好或狂好。
**能真正做到YES LOLITA NO TOUCH!!才有資格當[[情結|蘿莉控]]。
***不然[[三年起步,最高死刑]]。
===合法蘿莉===
*指看起來不像,但實際上已經成年的女性。
*反正看起來差不多,故劇情上多視為蘿莉,只是沒有法律上的阻礙。
**在美國只要看起來像蘿莉,吃下去就會被關。
**其實在日本也有<s>萬惡</s>軟倫(コンピュータソフトウェア倫理機構、Ethics Organization of Computer Software、EOCS)的5頭身規制,名曰 「自主規制」(自願),實則被軟倫盯上在營銷時會遇到無數麻煩。所以吃用設定年齡很大或根本就沒有設定年齡,外表卻過於年幼的女性的[[H|工口]]遊戲在公開場合還是很少見的。
== 文献 ==
<references />
27372bebb61d701715dd9111af79903ce16634a9
红茶维基:Copyright
4
791
1963
2023-03-26T04:04:35Z
Pio
2
重定向页面至[[红茶:版权]]
wikitext
text/x-wiki
#REDIRECT [[红茶:版权]]
d81fa9781179ef85f0194f0322a1b0bf1d4953db
MediaWiki:Common.js
8
502
1664
2023-03-29T13:30:49Z
Pio
2
javascript
text/javascript
//$(".mw-logo-wordmark").text("红茶维基");
//$("#footer-places-about a").text("关于红茶维基 LolikonWiki")
mw.loader.using( [ 'mediawiki.util' ] ).done( function() {
/* Trigger search box when click on the fake search button on main page */
if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) {
document.getElementById( 'skin-citizen-search-trigger' ).addEventListener( 'click', function() {
var event = new Event( 'input', { bubbles: true, composed: true } ),
checkbox = document.getElementById( 'citizen-search__checkbox' );
checkbox.checked = true;
checkbox.dispatchEvent( event );
} );
}
} );
d4986fe19432c995c66385f4753350e153c36855